fix FSCORE-150
git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@9036 d0543943-73ff-0310-b7d9-9358b9ac24b2
This commit is contained in:
parent
840b9f3367
commit
f7f58ec531
|
@ -407,7 +407,12 @@ static void *SWITCH_THREAD_FUNC console_thread(switch_thread_t *thread, void *ob
|
||||||
switch_memory_pool_t *pool = (switch_memory_pool_t *) obj;
|
switch_memory_pool_t *pool = (switch_memory_pool_t *) obj;
|
||||||
|
|
||||||
while (running) {
|
while (running) {
|
||||||
int32_t arg;
|
int32_t arg = 0;
|
||||||
|
|
||||||
|
if (getppid() == 1) {
|
||||||
|
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_WARNING, "We've become an orphan, no more console for us.\n");
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
switch_core_session_ctl(SCSC_CHECK_RUNNING, &arg);
|
switch_core_session_ctl(SCSC_CHECK_RUNNING, &arg);
|
||||||
if (!arg) {
|
if (!arg) {
|
||||||
|
@ -437,6 +442,7 @@ static void *SWITCH_THREAD_FUNC console_thread(switch_thread_t *thread, void *ob
|
||||||
}
|
}
|
||||||
|
|
||||||
switch_core_destroy_memory_pool(&pool);
|
switch_core_destroy_memory_pool(&pool);
|
||||||
|
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "Editline thread exiting\n");
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -681,7 +687,6 @@ SWITCH_DECLARE(switch_status_t) switch_console_set_alias(const char *string)
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
SWITCH_DECLARE(void) switch_console_loop(void)
|
SWITCH_DECLARE(void) switch_console_loop(void)
|
||||||
{
|
{
|
||||||
switch_thread_t *thread;
|
switch_thread_t *thread;
|
||||||
|
|
Loading…
Reference in New Issue