]> wimlib.net Git - wimlib/commitdiff
Only access struct stat.mtim if available
authorEric Biggers <ebiggers3@gmail.com>
Thu, 22 Nov 2012 05:22:21 +0000 (23:22 -0600)
committerEric Biggers <ebiggers3@gmail.com>
Thu, 22 Nov 2012 05:22:21 +0000 (23:22 -0600)
config.h.in [deleted file]
configure.ac
src/modify.c

diff --git a/config.h.in b/config.h.in
deleted file mode 100644 (file)
index 7b52011..0000000
+++ /dev/null
@@ -1,173 +0,0 @@
-/* config.h.in.  Generated from configure.ac by autoheader.  */
-
-/* Define if building universal (internal helper macro) */
-#undef AC_APPLE_UNIVERSAL_BUILD
-
-/* Define to 1 if including assertions. */
-#undef ENABLE_ASSERTIONS
-
-/* Define to 1 if supporting custom memory allocation functions */
-#undef ENABLE_CUSTOM_MEMORY_ALLOCATOR
-
-/* Define to 1 if including lots of debug messages. */
-#undef ENABLE_DEBUG
-
-/* Define to 1 if including error messages */
-#undef ENABLE_ERROR_MESSAGES
-
-/* Define to 1 if including even more debug messages. */
-#undef ENABLE_MORE_DEBUG
-
-/* Define to 1 if including support for multithreaded compression */
-#undef ENABLE_MULTITHREADED_COMPRESSION
-
-/* Define to 1 if using vectorized implementation of SHA1 */
-#undef ENABLE_SSSE3_SHA1
-
-/* Define to 1 to verify compressed data */
-#undef ENABLE_VERIFY_COMPRESSION
-
-/* Define to 1 if using the xattr interface to WIM alternate data streams */
-#undef ENABLE_XATTR
-
-/* Define to 1 if you have the <alloca.h> header file. */
-#undef HAVE_ALLOCA_H
-
-/* Define to 1 if you have the <attr/xattr.h> header file. */
-#undef HAVE_ATTR_XATTR_H
-
-/* Define to 1 if you have the <byteswap.h> header file. */
-#undef HAVE_BYTESWAP_H
-
-/* Define to 1 if you have the <dlfcn.h> header file. */
-#undef HAVE_DLFCN_H
-
-/* Define to 1 if you have the <endian.h> header file. */
-#undef HAVE_ENDIAN_H
-
-/* Define to 1 if you have the <errno.h> header file. */
-#undef HAVE_ERRNO_H
-
-/* Define to 1 if you have the `flock' function. */
-#undef HAVE_FLOCK
-
-/* Define if you have the iconv() function and it works. */
-#undef HAVE_ICONV
-
-/* Define to 1 if you have the <inttypes.h> header file. */
-#undef HAVE_INTTYPES_H
-
-/* Define to 1 if you have the `ntfs-3g' library (-lntfs-3g). */
-#undef HAVE_LIBNTFS_3G
-
-/* Define to 1 if you have the `lutimes' function. */
-#undef HAVE_LUTIMES
-
-/* Define to 1 if you have the <machine/endian.h> header file. */
-#undef HAVE_MACHINE_ENDIAN_H
-
-/* Define to 1 if you have the <memory.h> header file. */
-#undef HAVE_MEMORY_H
-
-/* Define to 1 if you have the <stdarg.h> header file. */
-#undef HAVE_STDARG_H
-
-/* Define to 1 if you have the <stdint.h> header file. */
-#undef HAVE_STDINT_H
-
-/* Define to 1 if you have the <stdlib.h> header file. */
-#undef HAVE_STDLIB_H
-
-/* Define to 1 if you have the <strings.h> header file. */
-#undef HAVE_STRINGS_H
-
-/* Define to 1 if you have the <string.h> header file. */
-#undef HAVE_STRING_H
-
-/* Define to 1 if you have the <sys/byteorder.h> header file. */
-#undef HAVE_SYS_BYTEORDER_H
-
-/* Define to 1 if you have the <sys/endian.h> header file. */
-#undef HAVE_SYS_ENDIAN_H
-
-/* Define to 1 if you have the <sys/file.h> header file. */
-#undef HAVE_SYS_FILE_H
-
-/* Define to 1 if you have the <sys/param.h> header file. */
-#undef HAVE_SYS_PARAM_H
-
-/* Define to 1 if you have the <sys/stat.h> header file. */
-#undef HAVE_SYS_STAT_H
-
-/* Define to 1 if you have the <sys/types.h> header file. */
-#undef HAVE_SYS_TYPES_H
-
-/* Define to 1 if you have the <unistd.h> header file. */
-#undef HAVE_UNISTD_H
-
-/* Define to 1 if you have the `utime' function. */
-#undef HAVE_UTIME
-
-/* Define to 1 if you have the `utimensat' function. */
-#undef HAVE_UTIMENSAT
-
-/* Define to 1 if you have the <utime.h> header file. */
-#undef HAVE_UTIME_H
-
-/* Define as const if the declaration of iconv() needs const. */
-#undef ICONV_CONST
-
-/* Define to the sub-directory in which libtool stores uninstalled libraries.
-   */
-#undef LT_OBJDIR
-
-/* Define to 1 if your C compiler doesn't accept -c and -o together. */
-#undef NO_MINUS_C_MINUS_O
-
-/* Name of package */
-#undef PACKAGE
-
-/* Define to the address where bug reports for this package should be sent. */
-#undef PACKAGE_BUGREPORT
-
-/* Define to the full name of this package. */
-#undef PACKAGE_NAME
-
-/* Define to the full name and version of this package. */
-#undef PACKAGE_STRING
-
-/* Define to the one symbol short name of this package. */
-#undef PACKAGE_TARNAME
-
-/* Define to the home page for this package. */
-#undef PACKAGE_URL
-
-/* Define to the version of this package. */
-#undef PACKAGE_VERSION
-
-/* Define to 1 if you have the ANSI C header files. */
-#undef STDC_HEADERS
-
-/* Version number of package */
-#undef VERSION
-
-/* Define to 1 if using FUSE. */
-#undef WITH_FUSE
-
-/* Define to 1 if using libcrypto SHA1 */
-#undef WITH_LIBCRYPTO
-
-/* Define to 1 to enable support for NTFS-specific information */
-#undef WITH_NTFS_3G
-
-/* Define WORDS_BIGENDIAN to 1 if your processor stores words with the most
-   significant byte first (like Motorola and SPARC, unlike Intel). */
-#if defined AC_APPLE_UNIVERSAL_BUILD
-# if defined __BIG_ENDIAN__
-#  define WORDS_BIGENDIAN 1
-# endif
-#else
-# ifndef WORDS_BIGENDIAN
-#  undef WORDS_BIGENDIAN
-# endif
-#endif
index c35b62ab0d53ad93fd8ce6c6fd98cf02fc589adf..799cc91132d55493d8f22ff4f4dd5da829a2b0f7 100644 (file)
@@ -34,6 +34,12 @@ AC_CHECK_HEADERS([endian.h byteswap.h sys/byteorder.h sys/endian.h \
                  sys/param.h machine/endian.h alloca.h stdlib.h stdarg.h \
                  errno.h attr/xattr.h utime.h sys/file.h])
 
                  sys/param.h machine/endian.h alloca.h stdlib.h stdarg.h \
                  errno.h attr/xattr.h utime.h sys/file.h])
 
+AC_CHECK_MEMBER([struct stat.st_mtim],
+               [AC_DEFINE([HAVE_STAT_NANOSECOND_PRECISION], [1],
+                         [Define to 1 if nanosecond precision timestamps are
+                          supported])],
+               [],
+               [[#include <sys/stat.h>]])
 
 AM_ICONV
 if test "x$am_cv_func_iconv" != "xyes"; then
 
 AM_ICONV
 if test "x$am_cv_func_iconv" != "xyes"; then
index ee6edb17f2e66e81a861f6aabcc67e4f5854e692..fbbf1bf2abcc77502723ef7f50c6060b49cbd56c 100644 (file)
@@ -167,9 +167,15 @@ static int build_dentry_tree(struct dentry **root_ret,
 
        inode = root->d_inode;
 
 
        inode = root->d_inode;
 
+#ifdef HAVE_STAT_NANOSECOND_PRECISION
        inode->creation_time = timespec_to_wim_timestamp(&root_stbuf.st_mtim);
        inode->last_write_time = timespec_to_wim_timestamp(&root_stbuf.st_mtim);
        inode->last_access_time = timespec_to_wim_timestamp(&root_stbuf.st_atim);
        inode->creation_time = timespec_to_wim_timestamp(&root_stbuf.st_mtim);
        inode->last_write_time = timespec_to_wim_timestamp(&root_stbuf.st_mtim);
        inode->last_access_time = timespec_to_wim_timestamp(&root_stbuf.st_atim);
+#else
+       inode->creation_time = unix_timestamp_to_wim(root_stbuf.st_mtime);
+       inode->last_write_time = unix_timestamp_to_wim(root_stbuf.st_mtime);
+       inode->last_access_time = unix_timestamp_to_wim(root_stbuf.st_atime);
+#endif
        if (sizeof(ino_t) >= 8)
                inode->ino = (u64)root_stbuf.st_ino;
        else
        if (sizeof(ino_t) >= 8)
                inode->ino = (u64)root_stbuf.st_ino;
        else