Matt McCutchen's Web Site
/
rsync
/
rsync.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Include a test for a working getopt_long because the one on some versions
[rsync/rsync.git]
/
rsync.c
diff --git
a/rsync.c
b/rsync.c
index
d7f2d3c
..
489afcf
100644
(file)
--- a/
rsync.c
+++ b/
rsync.c
@@
-57,7
+57,7
@@
int delete_file(char *fname)
int ret;
extern int recurse;
int ret;
extern int recurse;
- if (
do
_unlink(fname) == 0 || errno == ENOENT) return 0;
+ if (
robust
_unlink(fname) == 0 || errno == ENOENT) return 0;
#if SUPPORT_LINKS
ret = do_lstat(fname, &st);
#if SUPPORT_LINKS
ret = do_lstat(fname, &st);
@@
-262,7
+262,7
@@
void finish_transfer(char *fname, char *fnametmp, struct file_struct *file)
return;
/* move tmp file over real file */
return;
/* move tmp file over real file */
- if (
do
_rename(fnametmp,fname) != 0) {
+ if (
robust
_rename(fnametmp,fname) != 0) {
if (errno == EXDEV) {
/* rename failed on cross-filesystem link.
Copy the file instead. */
if (errno == EXDEV) {
/* rename failed on cross-filesystem link.
Copy the file instead. */
@@
-272,12
+272,11
@@
void finish_transfer(char *fname, char *fnametmp, struct file_struct *file)
} else {
set_perms(fname,file,NULL,0);
}
} else {
set_perms(fname,file,NULL,0);
}
- do_unlink(fnametmp);
} else {
rprintf(FERROR,"rename %s -> %s : %s\n",
fnametmp,fname,strerror(errno));
} else {
rprintf(FERROR,"rename %s -> %s : %s\n",
fnametmp,fname,strerror(errno));
- do_unlink(fnametmp);
}
}
+ do_unlink(fnametmp);
} else {
set_perms(fname,file,NULL,0);
}
} else {
set_perms(fname,file,NULL,0);
}