if (fd_pair(error_pipe) < 0
|| (need_name_pipe && fd_pair(name_pipe) < 0)) {
rsyserr(FERROR, errno, "pipe failed in do_recv");
if (fd_pair(error_pipe) < 0
|| (need_name_pipe && fd_pair(name_pipe) < 0)) {
rsyserr(FERROR, errno, "pipe failed in do_recv");
- if ((pid = do_fork()) == 0) {
+ if ((pid = do_fork()) == -1) {
+ rsyserr(FERROR, errno, "fork failed in do_recv");
+ exit_cleanup(RERR_IPC);
+ }
+
+ if (pid == 0) {
start_write_batch(f_out);
if (!read_batch) /* don't write to pipe */
flist = send_file_list(f_out,argc,argv);
start_write_batch(f_out);
if (!read_batch) /* don't write to pipe */
flist = send_file_list(f_out,argc,argv);