- Mention the latest enhancements.
[rsync/rsync.git] / main.c
diff --git a/main.c b/main.c
index 20c93c2..267cbd7 100644 (file)
--- a/main.c
+++ b/main.c
@@ -481,12 +481,17 @@ static int do_recv(int f_in,int f_out,struct file_list *flist,char *local_name)
        if (fd_pair(error_pipe) < 0
            || (need_name_pipe && fd_pair(name_pipe) < 0)) {
                rsyserr(FERROR, errno, "pipe failed in do_recv");
-               exit_cleanup(RERR_SOCKETIO);
+               exit_cleanup(RERR_IPC);
        }
 
        io_flush(NORMAL_FLUSH);
 
-       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) {
                close(error_pipe[0]);
                if (need_name_pipe) {
                        close(name_pipe[1]);