struct stats stats;
-extern int csum_length;
-
extern int verbose;
static void report(int f)
return name;
}
- if (flist->count == 1)
+ if (flist->count <= 1)
return name;
if (do_mkdir(name,0777 & ~orig_umask) != 0) {
argv[0] = ".";
}
- set_nonblocking(f_out);
- if (f_in != f_out)
- set_nonblocking(f_in);
-
flist = send_file_list(f_out,argc,argv);
if (!flist || flist->count == 0) {
exit_cleanup(0);
close(recv_pipe[0]);
if (f_in != f_out) close(f_out);
- set_nonblocking(f_in);
- set_nonblocking(recv_pipe[1]);
-
recv_files(f_in,flist,local_name,recv_pipe[1]);
report(f_in);
io_close_input(f_in);
if (f_in != f_out) close(f_in);
- set_nonblocking(f_out);
- set_nonblocking(recv_pipe[0]);
-
io_start_buffering(f_out);
generate_files(f_out,flist,local_name,recv_pipe[0]);
io_flush();
- waitpid(pid, &status, 0);
+ wait_process(pid, &status);
return status;
}
recv_exclude_list(f_in);
flist = recv_file_list(f_in);
- if (!flist || flist->count == 0) {
- rprintf(FERROR,"server_recv: nothing to do\n");
+ if (!flist) {
+ rprintf(FERROR,"server_recv: recv_file_list error\n");
exit_cleanup(RERR_FILESELECT);
}
extern int cvs_exclude;
extern int am_sender;
- set_nonblocking(f_out);
- if (f_in != f_out)
- set_nonblocking(f_in);
-
setup_protocol(f_out, f_in);
if (am_sender) {
if (verbose > 3)
rprintf(FINFO,"file list sent\n");
- set_nonblocking(f_out);
- if (f_in != f_out)
- set_nonblocking(f_in);
-
send_files(flist,f_out,f_in);
if (pid != -1) {
if (verbose > 3)
rprintf(FINFO,"client_run waiting on %d\n",pid);
io_flush();
- waitpid(pid, &status, 0);
+ wait_process(pid, &status);
}
report(-1);
exit_cleanup(status);
if (verbose > 3)
rprintf(FINFO,"client_run2 waiting on %d\n",pid);
io_flush();
- waitpid(pid, &status, 0);
+ wait_process(pid, &status);
}
return status | status2;