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
- Got rid of cleanup_buf (map-file cleanup is not needed).
[rsync/rsync.git]
/
rsync.c
diff --git
a/rsync.c
b/rsync.c
index
a9119fc
..
7a1c3f9
100644
(file)
--- a/
rsync.c
+++ b/
rsync.c
@@
-34,6
+34,7
@@
extern int force_delete;
extern int recurse;
extern int make_backups;
extern char *backup_dir;
extern int recurse;
extern int make_backups;
extern char *backup_dir;
+extern int inplace;
/*
/*
@@
-132,7
+133,7
@@
int set_perms(char *fname,struct file_struct *file,STRUCT_STAT *st,
return 0;
if (!st) {
return 0;
if (!st) {
- if (link_stat(fname,
&st2) !=
0) {
+ if (link_stat(fname,
&st2, 0) <
0) {
rsyserr(FERROR, errno, "stat %s failed",
full_fname(fname));
return 0;
rsyserr(FERROR, errno, "stat %s failed",
full_fname(fname));
return 0;
@@
-186,7
+187,7
@@
int set_perms(char *fname,struct file_struct *file,STRUCT_STAT *st,
* destination had the setuid or setgid bits set due
* to the side effect of the chown call */
if (st->st_mode & (S_ISUID | S_ISGID)) {
* destination had the setuid or setgid bits set due
* to the side effect of the chown call */
if (st->st_mode & (S_ISUID | S_ISGID)) {
- link_stat(fname, st);
+ link_stat(fname, st
, 0
);
}
updated = 1;
}
}
updated = 1;
}
@@
-239,7
+240,16
@@
void finish_transfer(char *fname, char *fnametmp, struct file_struct *file,
if (make_backups && !make_backup(fname))
return;
if (make_backups && !make_backup(fname))
return;
+ if (inplace) {
+ if (verbose > 2)
+ rprintf(FINFO, "finishing %s\n", fname);
+ set_perms(fname, file, NULL, 0);
+ return;
+ }
+
/* move tmp file over real file */
/* move tmp file over real file */
+ if (verbose > 2)
+ rprintf(FINFO, "renaming %s to %s\n", fnametmp, fname);
ret = robust_rename(fnametmp, fname, file->mode & INITACCESSPERMS);
if (ret < 0) {
rsyserr(FERROR, errno, "%s %s -> \"%s\"",
ret = robust_rename(fnametmp, fname, file->mode & INITACCESSPERMS);
if (ret < 0) {
rsyserr(FERROR, errno, "%s %s -> \"%s\"",