/* 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]);
rprintf(FINFO,"file list sent\n");
send_files(flist,f_out,f_in);
+ if (remote_version >= 24) {
+ /* final goodbye message */
+ read_int(f_in);
+ }
if (pid != -1) {
if (verbose > 3)
rprintf(FINFO,"client_run waiting on %d\n",pid);
io_flush();
wait_process(pid, &status);
}
- if (remote_version >= 24) {
- /* final goodbye message */
- read_int(f_in);
- }
report(-1);
exit_cleanup(status);
}
}
static RETSIGTYPE sigchld_handler(int val) {
+#ifdef WNOHANG
+ while (waitpid(-1, NULL, WNOHANG) > 0) ;
+#endif
}
int main(int argc,char *argv[])