[BACK]Return to receiver.c CVS log [TXT][DIR] Up to [local] / src / usr.bin / rsync

Diff for /src/usr.bin/rsync/receiver.c between version 1.19 and 1.20

version 1.19, 2019/02/18 21:55:27 version 1.20, 2019/03/22 19:56:47
Line 47 
Line 47 
 {  {
         uid_t            uid = (uid_t)-1;          uid_t            uid = (uid_t)-1;
         gid_t            gid = (gid_t)-1;          gid_t            gid = (gid_t)-1;
         struct timespec  tv[2];          struct timespec  ts[2];
   
         /*          /*
          * Conditionally adjust identifiers.           * Conditionally adjust identifiers.
Line 76 
Line 76 
         /* Conditionally adjust file modification time. */          /* Conditionally adjust file modification time. */
   
         if (sess->opts->preserve_times) {          if (sess->opts->preserve_times) {
                 struct timeval now;                  ts[0].tv_nsec = UTIME_NOW;
                   ts[1].tv_sec = f->st.mtime;
                 gettimeofday(&now, NULL);                  ts[1].tv_nsec = 0;
                 TIMEVAL_TO_TIMESPEC(&now, &tv[0]);                  if (futimens(fd, ts) == -1) {
                 tv[1].tv_sec = f->st.mtime;  
                 tv[1].tv_nsec = 0;  
                 if (futimens(fd, tv) == -1) {  
                         ERR(sess, "%s: futimens", path);                          ERR(sess, "%s: futimens", path);
                         return 0;                          return 0;
                 }                  }
Line 108 
Line 105 
 {  {
         uid_t            uid = (uid_t)-1;          uid_t            uid = (uid_t)-1;
         gid_t            gid = (gid_t)-1;          gid_t            gid = (gid_t)-1;
         struct timespec  tv[2];          struct timespec  ts[2];
   
         /*          /*
          * Conditionally adjust identifiers.           * Conditionally adjust identifiers.
Line 138 
Line 135 
         /* Conditionally adjust file modification time. */          /* Conditionally adjust file modification time. */
   
         if (sess->opts->preserve_times) {          if (sess->opts->preserve_times) {
                 struct timeval now;                  ts[0].tv_nsec = UTIME_NOW;
                   ts[1].tv_sec = f->st.mtime;
                 gettimeofday(&now, NULL);                  ts[1].tv_nsec = 0;
                 TIMEVAL_TO_TIMESPEC(&now, &tv[0]);                  if (utimensat(rootfd, path, ts, AT_SYMLINK_NOFOLLOW) == -1) {
                 tv[1].tv_sec = f->st.mtime;  
                 tv[1].tv_nsec = 0;  
                 if (utimensat(rootfd, path, tv, AT_SYMLINK_NOFOLLOW) == -1) {  
                         ERR(sess, "%s: utimensat", path);                          ERR(sess, "%s: utimensat", path);
                         return 0;                          return 0;
                 }                  }

Legend:
Removed from v.1.19  
changed lines
  Added in v.1.20