The wait_process() call now handles EINTR.
[rsync/rsync.git] / main.c
diff --git a/main.c b/main.c
index 2833435..e2d6aa7 100644 (file)
--- a/main.c
+++ b/main.c
@@ -103,7 +103,11 @@ static void show_malloc_stats(void);
  * remember_children(), we succeed instead of returning an error. */
 pid_t wait_process(pid_t pid, int *status_ptr, int flags)
 {
-       pid_t waited_pid = waitpid(pid, status_ptr, flags);
+       pid_t waited_pid;
+       
+       do {
+               waited_pid = waitpid(pid, status_ptr, flags);
+       } while (waited_pid == -1 && errno == EINTR);
 
        if (waited_pid == -1 && errno == ECHILD) {
                /* Status of requested child no longer available:  check to
@@ -695,8 +699,10 @@ static int do_recv(int f_in,int f_out,struct file_list *flist,char *local_name)
         * points to an identical file won't be replaced by the referent. */
        copy_links = copy_dirlinks = 0;
 
+#ifdef SUPPORT_HARD_LINKS
        if (preserve_hard_links)
                init_hard_links();
+#endif
 
        if (fd_pair(error_pipe) < 0) {
                rsyserr(FERROR, errno, "pipe failed in do_recv");