only reap sigchld when in fork mode for system

This commit is contained in:
Anthony Minessale 2011-09-12 16:14:30 -05:00
parent c1dd008b1d
commit 1e712c7e03
1 changed files with 6 additions and 1 deletions

View File

@ -1914,7 +1914,11 @@ SWITCH_DECLARE(void) switch_core_set_signal_handlers(void)
/* set signal handlers */
signal(SIGINT, SIG_IGN);
#ifndef WIN32
if (switch_test_flag((&runtime), SCF_THREADED_SYSTEM_EXEC)) {
signal(SIGCHLD, SIG_DFL);
} else {
signal(SIGCHLD, handle_SIGCHLD);
}
#endif
#ifdef SIGPIPE
signal(SIGPIPE, SIG_IGN);
@ -2293,6 +2297,7 @@ static void *SWITCH_THREAD_FUNC system_thread(switch_thread_t *thread, void *obj
#endif
sth->ret = system(sth->cmd);
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "WTF %d %s\n", sth->ret, strerror(errno));
#if 0
#if defined(HAVE_SETRLIMIT) && !defined(__FreeBSD__)