]> granicus.if.org Git - shadow/commitdiff
* configure.in: Check if the stat structure has a st_atim or
authornekral-guest <nekral-guest@5a98b0ae-9ef6-0310-add3-de5d479b70d7>
Sat, 30 Aug 2008 18:31:21 +0000 (18:31 +0000)
committernekral-guest <nekral-guest@5a98b0ae-9ef6-0310-add3-de5d479b70d7>
Sat, 30 Aug 2008 18:31:21 +0000 (18:31 +0000)
st_atimensec field.
* libmisc/copydir.c: Conditionally use the stat's st_atim and
st_atimensec fields.

ChangeLog
libmisc/copydir.c

index 399641ba643420b32fd83e038565b24b4ccdb524..668703d716e6b180cdc8158dbe6fad8dbb774857 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
        for the definition of uid_t and gid_t.
        * lib/pwmem.c: do not include <pwd.h>, "pwio.h" is sufficient
        here.
+       * configure.in: Check if the stat structure has a st_atim or
+       st_atimensec field.
+       * libmisc/copydir.c: Conditionally use the stat's st_atim and
+       st_atimensec fields.
 
 2008-08-26  Nicolas François  <nicolas.francois@centraliens.net>
 
index b887303c9cb28ea93eecf72567d046def8f56aad..cdd2037037d1eb74f886baf7f75efb6721d7df41 100644 (file)
@@ -288,16 +288,21 @@ static int copy_entry (const char *src, const char *dst,
        if (LSTAT (src, &sb) == -1) {
                /* If we cannot stat the file, do not care. */
        } else {
-#if  defined(_BSD_SOURCE) || defined(_SVID_SOURCE)
+#ifdef HAVE_STRUCT_STAT_ST_ATIM
                mt[0].tv_sec  = sb.st_atim.tv_sec;
                mt[0].tv_usec = sb.st_atim.tv_nsec / 1000;
                mt[1].tv_sec  = sb.st_mtim.tv_sec;
                mt[1].tv_usec = sb.st_mtim.tv_nsec / 1000;
 #else
                mt[0].tv_sec  = sb.st_atime;
-               mt[0].tv_usec = sb.st_atimensec / 1000;
                mt[1].tv_sec  = sb.st_mtime;
+#ifdef HAVE_STRUCT_STAT_ST_ATIMENSEC
+               mt[0].tv_usec = sb.st_atimensec / 1000;
                mt[1].tv_usec = sb.st_mtimensec / 1000;
+#else
+               mt[0].tv_usec = 0;
+               mt[1].tv_usec = 0;
+#endif
 #endif
 
                if (S_ISDIR (sb.st_mode)) {