]> git.ipfire.org Git - thirdparty/freeswitch.git/commitdiff
only reap sigchld when in fork mode for system
authorAnthony Minessale <anthm@freeswitch.org>
Mon, 12 Sep 2011 21:14:30 +0000 (16:14 -0500)
committerAnthony Minessale <anthm@freeswitch.org>
Mon, 12 Sep 2011 21:14:30 +0000 (16:14 -0500)
src/switch_core.c

index 4edf0dc576d40d803daf686fad6087b86d8b2803..c4ce502721003eea8b1b83d554d7ac8150318b9c 100644 (file)
@@ -1914,7 +1914,11 @@ SWITCH_DECLARE(void) switch_core_set_signal_handlers(void)
        /* set signal handlers */
        signal(SIGINT, SIG_IGN);
 #ifndef WIN32
-       signal(SIGCHLD, handle_SIGCHLD);
+       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__)