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
Made delete_one() handle a failed rmdir on a symlink when
[rsync/rsync.git]
/
main.c
diff --git
a/main.c
b/main.c
index
5ad1bf2
..
c6a3165
100644
(file)
--- a/
main.c
+++ b/
main.c
@@
-84,7
+84,7
@@
void wait_process(pid_t pid, int *status)
io_flush(FULL_FLUSH);
}
io_flush(FULL_FLUSH);
}
- if (
(waited_pid == -1) && (errno == ECHILD)
) {
+ if (
waited_pid == -1 && errno == ECHILD
) {
/* status of requested child no longer available.
* check to see if it was processed by the sigchld_handler.
*/
/* status of requested child no longer available.
* check to see if it was processed by the sigchld_handler.
*/
@@
-324,8
+324,8
@@
static char *get_local_name(struct file_list *flist,char *name)
if (do_stat(name,&st) == 0) {
if (S_ISDIR(st.st_mode)) {
if (!push_dir(name)) {
if (do_stat(name,&st) == 0) {
if (S_ISDIR(st.st_mode)) {
if (!push_dir(name)) {
- r
printf(FERROR, "push_dir %s failed: %s (1)\n
",
- full_fname(name)
, strerror(errno)
);
+ r
syserr(FERROR, errno, "push_dir#1 %s failed
",
+ full_fname(name));
exit_cleanup(RERR_FILESELECT);
}
return NULL;
exit_cleanup(RERR_FILESELECT);
}
return NULL;
@@
-341,8
+341,7
@@
static char *get_local_name(struct file_list *flist,char *name)
return name;
if (do_mkdir(name,0777 & ~orig_umask) != 0) {
return name;
if (do_mkdir(name,0777 & ~orig_umask) != 0) {
- rprintf(FERROR, "mkdir %s failed: %s\n",
- full_fname(name), strerror(errno));
+ rsyserr(FERROR, errno, "mkdir %s failed", full_fname(name));
exit_cleanup(RERR_FILEIO);
} else {
if (verbose > 0)
exit_cleanup(RERR_FILEIO);
} else {
if (verbose > 0)
@@
-350,8
+349,8
@@
static char *get_local_name(struct file_list *flist,char *name)
}
if (!push_dir(name)) {
}
if (!push_dir(name)) {
- r
printf(FERROR, "push_dir %s failed: %s (2)\n
",
- full_fname(name)
, strerror(errno)
);
+ r
syserr(FERROR, errno, "push_dir#2 %s failed
",
+ full_fname(name));
exit_cleanup(RERR_FILESELECT);
}
exit_cleanup(RERR_FILESELECT);
}
@@
-370,9
+369,15
@@
static void do_server_sender(int f_in, int f_out, int argc,char *argv[])
(long)getpid());
}
(long)getpid());
}
+ if (am_daemon && lp_write_only(module_id) && am_sender) {
+ rprintf(FERROR, "ERROR: module is write only\n");
+ exit_cleanup(RERR_SYNTAX);
+ return;
+ }
+
if (!relative_paths && !push_dir(dir)) {
if (!relative_paths && !push_dir(dir)) {
- r
printf(FERROR, "push_dir %s failed: %s (3)\n
",
- full_fname(dir)
, strerror(errno)
);
+ r
syserr(FERROR, errno, "push_dir#3 %s failed
",
+ full_fname(dir));
exit_cleanup(RERR_FILESELECT);
}
argc--;
exit_cleanup(RERR_FILESELECT);
}
argc--;
@@
-508,8
+513,8
@@
static void do_server_recv(int f_in, int f_out, int argc,char *argv[])
argc--;
argv++;
if (!am_daemon && !push_dir(dir)) {
argc--;
argv++;
if (!am_daemon && !push_dir(dir)) {
- r
printf(FERROR, "push_dir %s failed: %s (4)\n
",
- full_fname(dir)
, strerror(errno)
);
+ r
syserr(FERROR, errno, "push_dir#4 %s failed
",
+ full_fname(dir));
exit_cleanup(RERR_FILESELECT);
}
}
exit_cleanup(RERR_FILESELECT);
}
}
@@
-633,11
+638,10
@@
int client_run(int f_in, int f_out, pid_t pid, int argc, char *argv[])
exit_cleanup(status);
}
exit_cleanup(status);
}
- if (argc == 0)
{
+ if (argc == 0)
list_only = 1;
list_only = 1;
- }
- if (!
write
_batch)
+ if (!
read
_batch)
send_exclude_list(f_out);
if (filesfrom_fd >= 0) {
send_exclude_list(f_out);
if (filesfrom_fd >= 0) {