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) {
io_set_sock_fds(f_in, f_out);
setup_protocol(f_out, f_in);
+#if defined HAVE_ICONV_OPEN && defined HAVE_ICONV_H
+ setup_iconv();
+#endif
if (protocol_version >= 23)
io_start_multiplex_out();
io_set_sock_fds(f_in, f_out);
setup_protocol(f_out,f_in);
+#if defined HAVE_ICONV_OPEN && defined HAVE_ICONV_H
+ setup_iconv();
+#endif
if (protocol_version >= 23 && !read_batch)
io_start_multiplex_in();
_exit(0);
}
-static RETSIGTYPE sigchld_handler(UNUSED(int val))
+RETSIGTYPE remember_children(UNUSED(int val))
{
#ifdef WNOHANG
int cnt, status;
}
#endif
#ifndef HAVE_SIGACTION
- signal(SIGCHLD, sigchld_handler);
+ signal(SIGCHLD, remember_children);
#endif
}
#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);
/* 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