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
added "dont compress" option with the default setting of
[rsync/rsync.git]
/
rsync.c
diff --git
a/rsync.c
b/rsync.c
index
13c5f21
..
0f8d33b
100644
(file)
--- a/
rsync.c
+++ b/
rsync.c
@@
-94,7
+94,7
@@
int delete_file(char *fname)
if (strcmp(dname,".")==0 ||
strcmp(dname,"..")==0)
continue;
if (strcmp(dname,".")==0 ||
strcmp(dname,"..")==0)
continue;
- slprintf(buf, sizeof(buf)
-1
, "%s/%s", fname, dname);
+ slprintf(buf, sizeof(buf), "%s/%s", fname, dname);
if (verbose > 0)
rprintf(FINFO,"deleting %s\n", buf);
if (delete_file(buf) != 0) {
if (verbose > 0)
rprintf(FINFO,"deleting %s\n", buf);
if (delete_file(buf) != 0) {
@@
-133,11
+133,15
@@
int set_perms(char *fname,struct file_struct *file,STRUCT_STAT *st,
if (preserve_times && !S_ISLNK(st->st_mode) &&
st->st_mtime != file->modtime) {
if (preserve_times && !S_ISLNK(st->st_mode) &&
st->st_mtime != file->modtime) {
- updated = 1;
- if (set_modtime(fname,file->modtime) != 0) {
+ /* don't complain about not setting times on directories
+ because some filesystems can't do it */
+ if (set_modtime(fname,file->modtime) != 0 &&
+ !S_ISDIR(st->st_mode)) {
rprintf(FERROR,"failed to set times on %s : %s\n",
fname,strerror(errno));
return 0;
rprintf(FERROR,"failed to set times on %s : %s\n",
fname,strerror(errno));
return 0;
+ } else {
+ updated = 1;
}
}
}
}
@@
-184,7
+188,7
@@
int set_perms(char *fname,struct file_struct *file,STRUCT_STAT *st,
void sig_int(void)
{
void sig_int(void)
{
- exit_cleanup(
1
);
+ exit_cleanup(
RERR_SIGNAL
);
}
}
@@
-198,7
+202,7
@@
void finish_transfer(char *fname, char *fnametmp, struct file_struct *file)
rprintf(FERROR,"backup filename too long\n");
return;
}
rprintf(FERROR,"backup filename too long\n");
return;
}
- slprintf(fnamebak,sizeof(fnamebak)
-1
,"%s%s",fname,backup_suffix);
+ slprintf(fnamebak,sizeof(fnamebak),"%s%s",fname,backup_suffix);
if (do_rename(fname,fnamebak) != 0 && errno != ENOENT) {
rprintf(FERROR,"rename %s %s : %s\n",fname,fnamebak,strerror(errno));
return;
if (do_rename(fname,fnamebak) != 0 && errno != ENOENT) {
rprintf(FERROR,"rename %s %s : %s\n",fname,fnamebak,strerror(errno));
return;