aboutsummaryrefslogtreecommitdiffstats
path: root/backup.c
diff options
context:
space:
mode:
authorWayne Davison <wayned@samba.org>2004-06-10 16:43:52 +0000
committerWayne Davison <wayned@samba.org>2004-06-10 16:43:52 +0000
commit9fd62d15880b94c8353e1d1728fa85ee6ff9f6cf (patch)
treec853864b8c046f1571fcb4e81e73c64f8ff1428c /backup.c
parentb7061c82b47bf624b916df87d7813c4fbdb48c18 (diff)
downloadandroid_external_rsync-9fd62d15880b94c8353e1d1728fa85ee6ff9f6cf.tar.gz
android_external_rsync-9fd62d15880b94c8353e1d1728fa85ee6ff9f6cf.tar.bz2
android_external_rsync-9fd62d15880b94c8353e1d1728fa85ee6ff9f6cf.zip
The mkdir code should be using do_stat(), not do_lstat() to copy
each existing dir's mode & owner info.
Diffstat (limited to 'backup.c')
-rw-r--r--backup.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/backup.c b/backup.c
index 2c69acd1..b2f6de0e 100644
--- a/backup.c
+++ b/backup.c
@@ -98,7 +98,7 @@ static int make_bak_dir(char *fullpath)
if (p >= rel) {
/* Try to transfer the directory settings of the
* actual dir that the files are coming from. */
- if (do_lstat(rel, &st) != 0) {
+ if (do_stat(rel, &st) < 0) {
rsyserr(FERROR, errno,
"make_bak_dir stat %s failed",
full_fname(rel));
@@ -148,10 +148,12 @@ static int keep_backup(char *fname)
/* return if no file to keep */
#if SUPPORT_LINKS
- if (do_lstat(fname, &st)) return 1;
+ ret_code = do_lstat(fname, &st);
#else
- if (do_stat(fname, &st)) return 1;
+ ret_code = do_stat(fname, &st);
#endif
+ if (ret_code < 0)
+ return 1;
file = make_file(fname, NULL, NO_EXCLUDES);