X-Git-Url: https://mattmccutchen.net/rsync/rsync.git/blobdiff_plain/1ff5450d31ee81523f5af44acfc4556e5aa91036..1d3754aede7d43ec072dd5d4e6cec57094bcd85c:/main.c diff --git a/main.c b/main.c index 4cf4cf60..fa4fe0f7 100644 --- a/main.c +++ b/main.c @@ -49,7 +49,6 @@ static void report(int f) write_longint(f,read_total()); write_longint(f,write_total()); write_longint(f,total_size); - write_flush(f); return; } @@ -150,8 +149,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 (chdir(name) != 0) { - rprintf(FERROR,"chdir %s : %s (1)\n", + if (!push_dir(name, 0)) { + rprintf(FERROR,"push_dir %s : %s (1)\n", name,strerror(errno)); exit_cleanup(1); } @@ -177,8 +176,9 @@ static char *get_local_name(struct file_list *flist,char *name) rprintf(FINFO,"created directory %s\n",name); } - if (chdir(name) != 0) { - rprintf(FERROR,"chdir %s : %s (2)\n",name,strerror(errno)); + if (!push_dir(name, 0)) { + rprintf(FERROR,"push_dir %s : %s (2)\n", + name,strerror(errno)); exit_cleanup(1); } @@ -199,8 +199,8 @@ static void do_server_sender(int f_in, int f_out, int argc,char *argv[]) if (verbose > 2) rprintf(FINFO,"server_sender starting pid=%d\n",(int)getpid()); - if (!relative_paths && chdir(dir) != 0) { - rprintf(FERROR,"chdir %s: %s (3)\n",dir,strerror(errno)); + if (!relative_paths && !push_dir(dir, 0)) { + rprintf(FERROR,"push_dir %s: %s (3)\n",dir,strerror(errno)); exit_cleanup(1); } argc--; @@ -290,8 +290,8 @@ static void do_server_recv(int f_in, int f_out, int argc,char *argv[]) dir = argv[0]; argc--; argv++; - if (!am_daemon && chdir(dir) != 0) { - rprintf(FERROR,"chdir %s : %s (4)\n", + if (!am_daemon && !push_dir(dir, 0)) { + rprintf(FERROR,"push_dir %s : %s (4)\n", dir,strerror(errno)); exit_cleanup(1); }