Got rid of a redundant mtime check.
[rsync/rsync.git] / generator.c
index 530c274..f364eef 100644 (file)
@@ -517,6 +517,14 @@ static void do_delete_pass(void)
 
 int unchanged_attrs(const char *fname, struct file_struct *file, stat_x *sxp)
 {
+#ifndef HAVE_LUTIMES
+       if (S_ISLNK(file->mode)) {
+               ;
+       } else
+#endif
+       if (preserve_times && cmp_time(sxp->st.st_mtime, file->modtime) != 0)
+               return 0;
+
        if (preserve_perms && !BITS_EQUAL(sxp->st.st_mode, file->mode, CHMOD_BITS))
                return 0;
 
@@ -895,9 +903,6 @@ static int try_dests_reg(struct file_struct *file, char *fname, int ndx,
                case 2:
                        if (!unchanged_attrs(cmpbuf, file, sxp))
                                continue;
-                       if (always_checksum > 0 && preserve_times
-                        && cmp_time(sxp->st.st_mtime, file->modtime))
-                               continue;
                        best_match = j;
                        match_level = 3;
                        break;
@@ -1957,7 +1962,7 @@ void check_for_finished_files(int itemizing, enum logcode code, int check_redo)
 
                if (delete_during == 2 || !dir_tweaking) {
                        /* Skip directory touch-up. */
-               } else if (first_flist->ndx_start != 0)
+               } else if (first_flist->parent_ndx >= 0)
                        touch_up_dirs(dir_flist, first_flist->parent_ndx);
 
                flist_free(first_flist); /* updates first_flist */
@@ -2032,7 +2037,7 @@ void generate_files(int f_out, const char *local_name)
                }
 #endif
 
-               if (inc_recurse && cur_flist->ndx_start) {
+               if (inc_recurse && cur_flist->parent_ndx >= 0) {
                        struct file_struct *fp = dir_flist->files[cur_flist->parent_ndx];
                        f_name(fp, fbuf);
                        ndx = cur_flist->ndx_start - 1;