- if (preserve_uid && !(flags & XMIT_SAME_UID))
- uid = (uid_t)read_int(f);
-@@ -656,6 +669,7 @@ void receive_file_entry(struct file_stru
-
- file->flags = 0;
- file->modtime = modtime;
-+ file->atime = atime;
- file->length = file_length;
- file->mode = mode;
- file->uid = uid;
-@@ -896,6 +910,7 @@ skip_excludes:
-
- file->flags = flags;
- file->modtime = st.st_mtime;
-+ file->atime = st.st_atime;
- file->length = st.st_size;
- file->mode = st.st_mode;
- file->uid = st.st_uid;
---- orig/generator.c 2005-01-24 01:43:09
-+++ generator.c 2004-11-03 23:02:12
-@@ -97,7 +97,7 @@ static int unchanged_file(char *fn, stru
- if (ignore_times)
- return 0;
-
-- return cmp_modtime(st->st_mtime, file->modtime) == 0;
-+ return cmp_time(st->st_mtime, file->modtime) == 0;
- }
-
-
-@@ -497,7 +497,7 @@ static void recv_generator(char *fname,
- }
-
- if (update_only && fnamecmp_type == FNAMECMP_FNAME
-- && cmp_modtime(st.st_mtime, file->modtime) > 0) {
-+ && cmp_time(st.st_mtime, file->modtime) > 0) {
- if (verbose > 1)
- rprintf(FINFO, "%s is newer\n", safe_fname(fname));
- return;
---- orig/options.c 2005-01-24 01:43:10
-+++ options.c 2005-01-24 01:51:48
-@@ -49,6 +49,7 @@ int preserve_uid = 0;
+ if (chmod_modes && !S_ISLNK(mode))
+ mode = tweak_mode(mode, chmod_modes);
+@@ -791,6 +807,8 @@ static struct file_struct *recv_file_ent
+ F_OWNER(file) = uid;
+ if (preserve_gid)
+ F_GROUP(file) = gid;
++ if (preserve_atimes)
++ F_ATIME(file) = atime;
+
+ if (basename != thisname) {
+ file->dirname = lastdir;
+@@ -1096,6 +1114,8 @@ struct file_struct *make_file(const char
+ F_OWNER(file) = st.st_uid;
+ if (preserve_gid)
+ F_GROUP(file) = st.st_gid;
++ if (preserve_atimes)
++ F_ATIME(file) = st.st_atime;
+
+ if (basename != thisname)
+ file->dirname = lastdir;
+--- old/generator.c
++++ new/generator.c
+@@ -44,6 +44,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;
+@@ -552,6 +553,9 @@ void itemize(const char *fname, struct f
+ && (!(iflags & ITEM_XNAME_FOLLOWS) || *xname))
+ || (keep_time && cmp_time(file->modtime, sxp->st.st_mtime) != 0))
+ iflags |= ITEM_REPORT_TIME;
++ if (preserve_atimes && !S_ISDIR(file->mode) && !S_ISLNK(file->mode)
++ && cmp_time(F_ATIME(file), sxp->st.st_atime) != 0)
++ iflags |= ITEM_REPORT_ATIME;
+ if (!BITS_EQUAL(sxp->st.st_mode, file->mode, CHMOD_BITS))
+ iflags |= ITEM_REPORT_PERMS;
+ if (preserve_uid && am_root && F_UID(file) != sxp->st.st_uid)
+@@ -852,6 +856,8 @@ static int try_dests_reg(struct file_str
+ if (link_dest) {
+ if (!hard_link_one(file, fname, cmpbuf, 1))
+ goto try_a_copy;
++ if (preserve_atimes)
++ set_file_attrs(fname, file, sxp, 0);
+ if (preserve_hard_links && F_IS_HLINKED(file))
+ finish_hard_link(file, fname, &sxp->st, itemizing, code, j);
+ if (itemizing && (verbose > 1 || stdout_format_has_i > 1)) {
+@@ -1700,7 +1706,7 @@ static void touch_up_dirs(struct file_li
+ if (!(file->mode & S_IWUSR))
+ do_chmod(fname, file->mode);
+ if (need_retouch_dir_times)
+- set_modtime(fname, file->modtime, file->mode);
++ set_times(fname, file->modtime, file->modtime, file->mode);
+ if (allowed_lull && !(++j % lull_mod))
+ maybe_send_keepalive();
+ else if (!(j % 200))
+--- old/log.c
++++ new/log.c
+@@ -36,6 +36,7 @@ extern int msg_fd_out;
+ extern int allow_8bit_chars;
+ extern int protocol_version;
+ extern int preserve_times;
++extern int preserve_atimes;
+ extern int preserve_uid;
+ extern int preserve_gid;
+ extern int stdout_format_has_i;
+@@ -624,7 +625,8 @@ static void log_formatted(enum logcode c
+ c[5] = !(iflags & ITEM_REPORT_PERMS) ? '.' : 'p';
+ c[6] = !(iflags & ITEM_REPORT_OWNER) ? '.' : 'o';
+ c[7] = !(iflags & ITEM_REPORT_GROUP) ? '.' : 'g';
+- c[8] = !(iflags & ITEM_REPORT_ATIME) ? '.' : 'u';
++ c[8] = !(iflags & ITEM_REPORT_ATIME) ? '.'
++ : S_ISLNK(file->mode) ? 'U' : 'u';
+ c[9] = !(iflags & ITEM_REPORT_ACL) ? '.' : 'a';
+ c[10] = !(iflags & ITEM_REPORT_XATTR) ? '.' : 'x';
+ c[11] = '\0';
+--- old/options.c
++++ new/options.c
+@@ -55,6 +55,7 @@ int preserve_uid = 0;