Another try at socklen_t: just check for it, and otherwise use int.
[rsync/rsync.git] / main.c
diff --git a/main.c b/main.c
index 38df5a0..bc51571 100644 (file)
--- a/main.c
+++ b/main.c
@@ -360,7 +360,8 @@ static int do_recv(int f_in,int f_out,struct file_list *flist,char *local_name)
                /* finally we go to sleep until our parent kills us
                   with a USR2 signal. We sleep for a short time as on
                   some OSes a signal won't interrupt a sleep! */
-               while (1) msleep(20);
+               while (msleep(20))
+                       ;
        }
 
        close(recv_pipe[1]);
@@ -700,6 +701,9 @@ static RETSIGTYPE sigusr2_handler(int val) {
 }
 
 static RETSIGTYPE sigchld_handler(int val) {
+#ifdef WNOHANG
+       while (waitpid(-1, NULL, WNOHANG) > 0) ;
+#endif
 }
 
 int main(int argc,char *argv[])