X-Git-Url: https://mattmccutchen.net/rsync/rsync.git/blobdiff_plain/8840ec0f49157bc390b3dda5467287a0290ac4f1..f041b025573c494d19215134fe4f39e729a59d76:/clientserver.c diff --git a/clientserver.c b/clientserver.c index 3b53958f..f55117ca 100644 --- a/clientserver.c +++ b/clientserver.c @@ -63,6 +63,10 @@ struct chmod_mode_struct *daemon_chmod_modes; /* Length of lp_path() string when in daemon mode & not chrooted, else 0. */ unsigned int module_dirlen = 0; +#ifdef HAVE_SIGACTION +static struct sigaction sigact; +#endif + /** * Run a client connected to an rsyncd. The alternative to this * function for remote-shell connections is do_cmd(). @@ -686,6 +690,10 @@ static int rsync_module(int f_in, int f_out, int i) if (lp_timeout(i) && lp_timeout(i) > io_timeout) set_io_timeout(lp_timeout(i)); + /* If we have some incoming/outgoing chmod changes, append them to + * any user-specified changes (making our changes have priority). + * We also get a pointer to just our changes so that a receiver + * process can use them separately if --perms wasn't specified. */ if (am_sender) p = lp_outgoing_chmod(i); else @@ -796,6 +804,11 @@ int start_daemon(int f_in, int f_out) return -1; } +#ifdef HAVE_SIGACTION + sigact.sa_flags = SA_NOCLDSTOP; +#endif + SIGACTION(SIGCHLD, remember_children); + return rsync_module(f_in, f_out, i); }