X-Git-Url: https://mattmccutchen.net/rsync/rsync.git/blobdiff_plain/088aac85971f3f1571c7f90569c95d5025b1fd82..b84ba8967a591b52abda755f809842e3bcd74f98:/main.c diff --git a/main.c b/main.c index 0ed7df38..6213678f 100644 --- a/main.c +++ b/main.c @@ -280,7 +280,8 @@ static char *get_local_name(struct file_list *flist,char *name) return name; if (do_mkdir(name,0777 & ~orig_umask) != 0) { - rprintf(FERROR,"mkdir %s : %s (1)\n",name,strerror(errno)); + rprintf(FERROR, RSYNC_NAME ": mkdir %s: %s\n", + name, strerror(errno)); exit_cleanup(RERR_FILEIO); } else { if (verbose > 0) @@ -288,8 +289,8 @@ static char *get_local_name(struct file_list *flist,char *name) } if (!push_dir(name, 0)) { - rprintf(FERROR,"push_dir %s : %s (2)\n", - name,strerror(errno)); + rprintf(FERROR, RSYNC_NAME ": push_dir %s: %s\n", + name, strerror(errno)); exit_cleanup(RERR_FILESELECT); } @@ -839,10 +840,13 @@ int main(int argc,char *argv[]) } signal(SIGINT,SIGNAL_CAST sig_int); - signal(SIGPIPE,SIGNAL_CAST sig_int); signal(SIGHUP,SIGNAL_CAST sig_int); signal(SIGTERM,SIGNAL_CAST sig_int); + /* Ignore SIGPIPE; we consistently check error codes and will + * see the EPIPE. */ + signal(SIGPIPE, SIG_IGN); + /* Initialize push_dir here because on some old systems getcwd (implemented by forking "pwd" and reading its output) doesn't work when there are other child processes. Also, on all systems