summaryrefslogtreecommitdiff
path: root/backup.c
diff options
context:
space:
mode:
authorWayne Davison <wayned@samba.org>2009-01-03 08:53:59 -0800
committerWayne Davison <wayned@samba.org>2009-01-03 08:53:59 -0800
commit09ca0d15d31d93a5964a1db4c387879f31c22831 (patch)
treea966cbf8f02b8796d5c8d9f66e3c533ad97a4b41 /backup.c
parentc43c66125e8fd35896a358ccce9687ebcfe82dc5 (diff)
downloadrsync-09ca0d15d31d93a5964a1db4c387879f31c22831.tar.gz
Added init_stat_x() to avoid duplication of acl/xattr init code.
Diffstat (limited to 'backup.c')
-rw-r--r--backup.c17
1 files changed, 4 insertions, 13 deletions
diff --git a/backup.c b/backup.c
index 60c85b17..b40da92f 100644
--- a/backup.c
+++ b/backup.c
@@ -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 */