X-Git-Url: https://mattmccutchen.net/rsync/rsync.git/blobdiff_plain/9656de5d13a914e79643fe5e403c6303205a042f..6d59ac192b6df345ab04035ea3bc6751c3537307:/main.c diff --git a/main.c b/main.c index dfee754a..c82453e0 100644 --- a/main.c +++ b/main.c @@ -88,14 +88,14 @@ static int64 total_read, total_written; static void show_malloc_stats(void); /* Works like waitpid(), but if we already harvested the child pid in our - * sigchld_handler(), we succeed instead of returning an error. */ + * 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); if (waited_pid == -1 && errno == ECHILD) { /* Status of requested child no longer available: check to - * see if it was processed by sigchld_handler(). */ + * see if it was processed by remember_children(). */ int cnt; for (cnt = 0; cnt < MAXCHILDPROCS; cnt++) { if (pid == pid_stat_table[cnt].pid) { @@ -792,7 +792,7 @@ void start_server(int f_in, int f_out, int argc, char *argv[]) io_set_sock_fds(f_in, f_out); setup_protocol(f_out, f_in); -#ifdef HAVE_ICONV +#if defined HAVE_ICONV_OPEN && defined HAVE_ICONV_H setup_iconv(); #endif @@ -831,7 +831,7 @@ int client_run(int f_in, int f_out, pid_t pid, int argc, char *argv[]) io_set_sock_fds(f_in, f_out); setup_protocol(f_out,f_in); -#ifdef HAVE_ICONV +#if defined HAVE_ICONV_OPEN && defined HAVE_ICONV_H setup_iconv(); #endif @@ -1093,7 +1093,7 @@ static RETSIGTYPE sigusr2_handler(UNUSED(int val)) _exit(0); } -static RETSIGTYPE sigchld_handler(UNUSED(int val)) +RETSIGTYPE remember_children(UNUSED(int val)) { #ifdef WNOHANG int cnt, status; @@ -1115,7 +1115,7 @@ static RETSIGTYPE sigchld_handler(UNUSED(int val)) } #endif #ifndef HAVE_SIGACTION - signal(SIGCHLD, sigchld_handler); + signal(SIGCHLD, remember_children); #endif } @@ -1186,7 +1186,7 @@ int main(int argc,char *argv[]) #endif SIGACTMASK(SIGUSR1, sigusr1_handler); SIGACTMASK(SIGUSR2, sigusr2_handler); - SIGACTMASK(SIGCHLD, sigchld_handler); + SIGACTMASK(SIGCHLD, remember_children); #ifdef MAINTAINER_MODE SIGACTMASK(SIGSEGV, rsync_panic_handler); SIGACTMASK(SIGFPE, rsync_panic_handler); @@ -1229,6 +1229,9 @@ int main(int argc,char *argv[]) /* Ignore SIGPIPE; we consistently check error codes and will * see the EPIPE. */ SIGACTION(SIGPIPE, SIG_IGN); +#ifdef SIGXFSZ + SIGACTION(SIGXFSZ, SIG_IGN); +#endif /* Initialize push_dir here because on some old systems getcwd * (implemented by forking "pwd" and reading its output) doesn't