The branch, master has been updated via 78b5bc66 Enable --atimes on macOS. via f41cdc75 Check ro in set_create_time() for Cygwin too. from c8e7c4b3 Avoid an issue where the size of st_dev != dev_t.
https://git.samba.org/?p=rsync.git;a=shortlog;h=master - Log ----------------------------------------------------------------- commit 78b5bc66290aa24c69966110421a005faa37a625 Author: Wayne Davison <wa...@opencoder.net> Date: Sat Oct 2 10:16:58 2021 -0700 Enable --atimes on macOS. commit f41cdc75a184b73eb81dd251c12ef6e2998e6005 Author: Wayne Davison <wa...@opencoder.net> Date: Sat Oct 2 11:39:41 2021 -0700 Check ro in set_create_time() for Cygwin too. ----------------------------------------------------------------------- Summary of changes: NEWS.md | 2 ++ acls.c | 1 + rsync.h | 2 +- syscall.c | 24 +++++++++++++++--------- 4 files changed, 19 insertions(+), 10 deletions(-) Changeset truncated at 500 lines: diff --git a/NEWS.md b/NEWS.md index 5e93ce11..74c3edfc 100644 --- a/NEWS.md +++ b/NEWS.md @@ -51,6 +51,8 @@ - Reduced memory usage for an incremental transfer that has a bunch of small diretories. + - Add support for `--atimes` on macOS. + - Rsync can now update the xattrs on a read-only file when your user can temporarily add user-write permission to the file. (It always worked for a root transfer.) diff --git a/acls.c b/acls.c index 4303c2a7..c98f7b40 100644 --- a/acls.c +++ b/acls.c @@ -763,6 +763,7 @@ static int recv_rsync_acl(int f, item_list *racl_list, SMB_ACL_TYPE_T type, mode #ifdef HAVE_OSX_ACLS /* If we received a superfluous mask, throw it away. */ duo_item->racl.mask_obj = NO_ENTRY; + (void)mode; #else if (duo_item->racl.names.count && duo_item->racl.mask_obj == NO_ENTRY) { /* Mask must be non-empty with lists. */ diff --git a/rsync.h b/rsync.h index f8fcbffb..1fe4a12f 100644 --- a/rsync.h +++ b/rsync.h @@ -584,7 +584,7 @@ typedef unsigned int size_t; #endif #endif -#ifndef __APPLE__ /* Do we need a configure check for this? */ +#if !defined __APPLE__ || defined HAVE_GETATTRLIST #define SUPPORT_ATIMES 1 #endif diff --git a/syscall.c b/syscall.c index bf0de8ba..abb00575 100644 --- a/syscall.c +++ b/syscall.c @@ -388,18 +388,22 @@ OFF_T do_lseek(int fd, OFF_T offset, int whence) int do_setattrlist_times(const char *fname, STRUCT_STAT *stp) { struct attrlist attrList; - struct timespec ts; + struct timespec ts[2]; if (dry_run) return 0; RETURN_ERROR_IF_RO_OR_LO; - ts.tv_sec = stp->st_mtime; - ts.tv_nsec = stp->ST_MTIME_NSEC; + /* Yes, this is in the opposite order of utime and similar. */ + ts[0].tv_sec = stp->st_mtime; + ts[0].tv_nsec = stp->ST_MTIME_NSEC; + + ts[1].tv_sec = stp->st_atime; + ts[1].tv_nsec = stp->ST_ATIME_NSEC; memset(&attrList, 0, sizeof attrList); attrList.bitmapcount = ATTR_BIT_MAP_COUNT; - attrList.commonattr = ATTR_CMN_MODTIME; - return setattrlist(fname, &attrList, &ts, sizeof ts, FSOPT_NOFOLLOW); + attrList.commonattr = ATTR_CMN_MODTIME | ATTR_CMN_ACCTIME; + return setattrlist(fname, &attrList, ts, sizeof ts, FSOPT_NOFOLLOW); } #endif @@ -427,13 +431,14 @@ time_t get_create_time(const char *path, STRUCT_STAT *stp) int set_create_time(const char *path, time_t crtime) { + if (dry_run) return 0; + RETURN_ERROR_IF_RO_OR_LO; + + { #ifdef HAVE_GETATTRLIST struct attrlist attrList; struct timespec ts; - if (dry_run) return 0; - RETURN_ERROR_IF_RO_OR_LO; - ts.tv_sec = crtime; ts.tv_nsec = 0; @@ -462,8 +467,9 @@ int set_create_time(const char *path, time_t crtime) CloseHandle(handle); return ok ? 0 : -1; #endif + } } -#endif +#endif /* SUPPORT_CRTIMES */ #ifdef HAVE_UTIMENSAT int do_utimensat(const char *fname, STRUCT_STAT *stp) -- The rsync repository. _______________________________________________ rsync-cvs mailing list rsync-cvs@lists.samba.org https://lists.samba.org/mailman/listinfo/rsync-cvs