+--- old/generator.c
++++ new/generator.c
+@@ -45,6 +45,7 @@ extern int preserve_perms;
+ extern int preserve_uid;
+ extern int preserve_gid;
+ extern int preserve_times;
++extern int preserve_atimes;
+ extern int omit_dir_times;
+ extern int delete_mode;
+ extern int delete_before;
+@@ -91,6 +92,7 @@ extern dev_t filesystem_dev;
+ extern char *backup_dir;
+ extern char *backup_suffix;
+ extern int backup_suffix_len;
++extern unsigned int file_struct_len;
+ extern struct file_list *the_file_list;
+ extern struct filter_list_struct server_filter_list;
+
+@@ -185,7 +187,7 @@ static int delete_item(char *fname, int
+ for (j = dirlist->count; j--; ) {
+ struct file_struct *fp = dirlist->files[j];
+
+- if (fp->flags & FLAG_MOUNT_POINT)
++ if (FFLAGS(fp) & FLAG_MOUNT_POINT)
+ continue;
+
+ strlcpy(p, fp->basename, remainder);
+@@ -263,7 +265,7 @@ static void delete_in_dir(struct file_li
+ filt_array[cur_depth] = push_local_filters(fbuf, dlen);
+
+ if (one_file_system) {
+- if (file->flags & FLAG_TOP_DIR)
++ if (FFLAGS(file) & FLAG_TOP_DIR)
+ filesystem_dev = stp->st_dev;
+ else if (filesystem_dev != stp->st_dev)
+ return;
+@@ -275,7 +277,7 @@ static void delete_in_dir(struct file_li
+ * from the filesystem. */
+ for (i = dirlist->count; i--; ) {
+ struct file_struct *fp = dirlist->files[i];
+- if (!fp->basename || fp->flags & FLAG_MOUNT_POINT)
++ if (!fp->basename || FFLAGS(fp) & FLAG_MOUNT_POINT)
+ continue;
+ if (flist_find(flist, fp) < 0) {
+ f_name(fp, delbuf);
+@@ -301,11 +303,11 @@ static void do_delete_pass(struct file_l
+ for (j = 0; j < flist->count; j++) {
+ struct file_struct *file = flist->files[j];
+
+- if (!(file->flags & FLAG_DEL_HERE))
++ if (!(FFLAGS(file) & FLAG_DEL_HERE))
+ continue;
+
+ f_name(file, fbuf);
+- if (verbose > 1 && file->flags & FLAG_TOP_DIR)
++ if (verbose > 1 && FFLAGS(file) & FLAG_TOP_DIR)
+ rprintf(FINFO, "deleting in %s\n", fbuf);
+
+ if (link_stat(fbuf, &st, keep_dirlinks) < 0
+@@ -349,6 +351,9 @@ void itemize(struct file_struct *file, i
+ && (!(iflags & ITEM_XNAME_FOLLOWS) || *xname))
+ || (keep_time && cmp_time(file->modtime, st->st_mtime) != 0))
+ iflags |= ITEM_REPORT_TIME;
++ if (preserve_atimes && !S_ISDIR(file->mode) && !S_ISLNK(file->mode)
++ && cmp_time(file->atime, st->st_atime) != 0)
++ iflags |= ITEM_REPORT_ATIME;
+ if ((file->mode & CHMOD_BITS) != (st->st_mode & CHMOD_BITS))
+ iflags |= ITEM_REPORT_PERMS;
+ if (preserve_uid && am_root && file->uid != st->st_uid)
+@@ -550,7 +555,7 @@ static int find_fuzzy(struct file_struct
+ uint32 dist;
+
+ if (!S_ISREG(fp->mode) || !fp->length
+- || fp->flags & FLAG_NO_FUZZY)
++ || FFLAGS(fp) & FLAG_NO_FUZZY)
+ continue;
+
+ name = fp->basename;
+@@ -659,6 +664,8 @@ static int try_dests_reg(struct file_str
+ itemizing && verbose > 1,
+ code) < 0)
+ goto try_a_copy;
++ if (preserve_atimes)
++ set_file_attrs(fname, file, stp, 0);
+ if (preserve_hard_links && file->link_u.links)
+ hard_link_cluster(file, ndx, itemizing, code);
+ } else if (itemizing)
+@@ -906,7 +913,7 @@ static void recv_generator(char *fname,
+ && verbose && code && f_out != -1)
+ rprintf(code, "%s/\n", fname);
+ if (delete_during && f_out != -1 && !phase && dry_run < 2
+- && (file->flags & FLAG_DEL_HERE))
++ && (FFLAGS(file) & FLAG_DEL_HERE))
+ delete_in_dir(the_file_list, fname, file, &st);
+ return;