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:
100b62b
)
Made robust_rename() return a 1 if it had to copy the file.
author
Wayne Davison
<wayned@samba.org>
Mon, 9 Aug 2004 20:48:38 +0000
(20:48 +0000)
committer
Wayne Davison
<wayned@samba.org>
Mon, 9 Aug 2004 20:48:38 +0000
(20:48 +0000)
util.c
patch
|
blob
|
blame
|
history
diff --git
a/util.c
b/util.c
index
28a00ef
..
449b101
100644
(file)
--- a/
util.c
+++ b/
util.c
@@
-362,8
+362,8
@@
int robust_unlink(char *fname)
#endif
}
#endif
}
-/* Returns 0 on success
, -1 on most errors, and -2 if we got an error
- *
trying to copy the file across file system
s. */
+/* Returns 0 on success
ful rename, 1 if we successfully copied the file
+ *
across filesystems, -2 if copy_file() failed, and -1 on other error
s. */
int robust_rename(char *from, char *to, int mode)
{
int tries = 4;
int robust_rename(char *from, char *to, int mode)
{
int tries = 4;
@@
-383,7
+383,7
@@
int robust_rename(char *from, char *to, int mode)
if (copy_file(from, to, mode) != 0)
return -2;
do_unlink(from);
if (copy_file(from, to, mode) != 0)
return -2;
do_unlink(from);
- return
0
;
+ return
1
;
default:
return -1;
}
default:
return -1;
}