X-Git-Url: https://mattmccutchen.net/rsync/rsync.git/blobdiff_plain/c4c9bb944bf6d1e17b8884a41a932db26528372e..cbbd8e2e8bf72aa46c84c7de43e19da40f040fa7:/generator.c diff --git a/generator.c b/generator.c index 4ebc5e55..52732016 100644 --- a/generator.c +++ b/generator.c @@ -4,7 +4,7 @@ * Copyright (C) 1996-2000 Andrew Tridgell * Copyright (C) 1996 Paul Mackerras * Copyright (C) 2002 Martin Pool - * Copyright (C) 2003-2007 Wayne Davison + * Copyright (C) 2003-2008 Wayne Davison * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -1949,8 +1949,12 @@ static void touch_up_dirs(struct file_list *flist, int ndx) fname = f_name(file, NULL); if (!(file->mode & S_IWUSR)) do_chmod(fname, file->mode); - if (need_retouch_dir_times) - set_modtime(fname, file->modtime, file->mode); + if (need_retouch_dir_times) { + STRUCT_STAT st; + if (link_stat(fname, &st, 0) == 0 + && cmp_time(st.st_mtime, file->modtime) != 0) + set_modtime(fname, file->modtime, file->mode); + } if (allowed_lull && !(counter % lull_mod)) maybe_send_keepalive(); else if (!(counter & 0xFF))