diff options
author | Wayne Davison <wayned@samba.org> | 2009-01-03 08:53:59 -0800 |
---|---|---|
committer | Wayne Davison <wayned@samba.org> | 2009-01-03 08:53:59 -0800 |
commit | 09ca0d15d31d93a5964a1db4c387879f31c22831 (patch) | |
tree | a966cbf8f02b8796d5c8d9f66e3c533ad97a4b41 /backup.c | |
parent | c43c66125e8fd35896a358ccce9687ebcfe82dc5 (diff) | |
download | android_external_rsync-09ca0d15d31d93a5964a1db4c387879f31c22831.tar.gz android_external_rsync-09ca0d15d31d93a5964a1db4c387879f31c22831.tar.bz2 android_external_rsync-09ca0d15d31d93a5964a1db4c387879f31c22831.zip |
Added init_stat_x() to avoid duplication of acl/xattr init code.
Diffstat (limited to 'backup.c')
-rw-r--r-- | backup.c | 17 |
1 files changed, 4 insertions, 13 deletions
@@ -19,6 +19,7 @@ */ #include "rsync.h" +#include "ifuncs.h" extern int am_root; extern int preserve_acls; @@ -131,17 +132,12 @@ int make_bak_dir(const char *fullpath) if (p >= rel) { /* Try to transfer the directory settings of the * actual dir that the files are coming from. */ + init_stat_x(&sx); if (x_stat(rel, &sx.st, NULL) < 0) { rsyserr(FERROR, errno, "make_bak_dir stat %s failed", full_fname(rel)); } else { -#ifdef SUPPORT_ACLS - sx.acc_acl = sx.def_acl = NULL; -#endif -#ifdef SUPPORT_XATTRS - sx.xattr = NULL; -#endif if (!(file = make_file(rel, NULL, NULL, 0, NO_FILTERS))) continue; #ifdef SUPPORT_ACLS @@ -207,15 +203,10 @@ static int keep_backup(const char *fname) int kept = 0; int ret_code; - /* return if no file to keep */ + init_stat_x(&sx); + /* Return success if no file to keep. */ if (x_lstat(fname, &sx.st, NULL) < 0) return 1; -#ifdef SUPPORT_ACLS - sx.acc_acl = sx.def_acl = NULL; -#endif -#ifdef SUPPORT_XATTRS - sx.xattr = NULL; -#endif if (!(file = make_file(fname, NULL, NULL, 0, NO_FILTERS))) return 1; /* the file could have disappeared */ |