Update the copyright year.
[rsync/rsync.git] / backup.c
index 60c85b1..8907b25 100644 (file)
--- a/backup.c
+++ b/backup.c
@@ -2,7 +2,7 @@
  * Backup handling code.
  *
  * Copyright (C) 1999 Andrew Tridgell
- * Copyright (C) 2003-2008 Wayne Davison
+ * Copyright (C) 2003-2009 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
@@ -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 */