]> git.ipfire.org Git - thirdparty/rsync.git/commitdiff
Change do_setattrlist_times() to use an stp arg.
authorWayne Davison <wayne@opencoder.net>
Sun, 26 Apr 2020 04:39:11 +0000 (21:39 -0700)
committerWayne Davison <wayne@opencoder.net>
Sun, 26 Apr 2020 04:39:11 +0000 (21:39 -0700)
syscall.c
util.c

index 35caa07dc08b492313a07b9498104858d12ef711..bcd9738e93481eb88dc8381a01c005868e884d52 100644 (file)
--- a/syscall.c
+++ b/syscall.c
@@ -367,7 +367,7 @@ OFF_T do_lseek(int fd, OFF_T offset, int whence)
 }
 
 #ifdef HAVE_SETATTRLIST
-int do_setattrlist_times(const char *fname, time_t modtime, uint32 mod_nsec)
+int do_setattrlist_times(const char *fname, STRUCT_STAT *stp)
 {
        struct attrlist attrList;
        struct timespec ts;
@@ -375,8 +375,8 @@ int do_setattrlist_times(const char *fname, time_t modtime, uint32 mod_nsec)
        if (dry_run) return 0;
        RETURN_ERROR_IF_RO_OR_LO;
 
-       ts.tv_sec = modtime;
-       ts.tv_nsec = mod_nsec;
+       ts.tv_sec = stp->st_mtime;
+       ts.tv_nsec = stp->ST_MTIME_NSEC;
 
        memset(&attrList, 0, sizeof attrList);
        attrList.bitmapcount = ATTR_BIT_MAP_COUNT;
diff --git a/util.c b/util.c
index 1935a7711e8f47f0aa6ff0c0041cf2720d772a04..03917c3161244142bf6ee880b5da2b843baf0f0d 100644 (file)
--- a/util.c
+++ b/util.c
@@ -131,7 +131,7 @@ int set_times(const char *fname, STRUCT_STAT *stp)
        switch (switch_step) {
 #ifdef HAVE_SETATTRLIST
 #include "case_N.h"
-               if (do_setattrlist_times(fname, modtime, mod_nsec) == 0)
+               if (do_setattrlist_times(fname, stp) == 0)
                        break;
                if (errno != ENOSYS)
                        return -1;