Matt McCutchen's Web Site
/
rsync
/
rsync.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
f203266
)
Use make_bak_dir() if we get ENOENT while trying to open an
author
Wayne Davison
<wayned@samba.org>
Sun, 23 Sep 2007 19:45:22 +0000
(19:45 +0000)
committer
Wayne Davison
<wayned@samba.org>
Sun, 23 Sep 2007 19:45:22 +0000
(19:45 +0000)
inplace backup file.
generator.c
patch
|
blob
|
blame
|
history
diff --git
a/generator.c
b/generator.c
index
f711ffd
..
271b55f
100644
(file)
--- a/
generator.c
+++ b/
generator.c
@@
-1709,8
+1709,9
@@
static void recv_generator(char *fname, struct file_struct *file, int ndx,
close(fd);
goto cleanup;
}
- if ((f_copy = do_open(backupptr,
- O_WRONLY | O_CREAT | O_TRUNC | O_EXCL, 0600)) < 0) {
+ if ((f_copy = do_open(backupptr, O_WRONLY | O_CREAT | O_TRUNC | O_EXCL, 0600)) < 0
+ && (errno != ENOENT || make_bak_dir(backupptr) < 0
+ || (f_copy = do_open(backupptr, O_WRONLY | O_CREAT | O_TRUNC | O_EXCL, 0600)) < 0)) {
rsyserr(FERROR, errno, "open %s",
full_fname(backupptr));
unmake_file(back_file);