mirror of
https://github.com/signalwire/freeswitch.git
synced 2026-07-24 05:02:10 +00:00
add fsctl shutdown [elegant|restart] <- one or both keywords
git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@9788 d0543943-73ff-0310-b7d9-9358b9ac24b2
This commit is contained in:
+9
-2
@@ -270,6 +270,7 @@ int main(int argc, char *argv[])
|
||||
int high_prio = 0;
|
||||
switch_core_flag_t flags = SCF_USE_SQL;
|
||||
int ret;
|
||||
switch_status_t destroy_status;
|
||||
switch_file_t *fd;
|
||||
switch_memory_pool_t *pool = NULL;
|
||||
|
||||
@@ -607,14 +608,20 @@ int main(int argc, char *argv[])
|
||||
|
||||
switch_core_runtime_loop(nc);
|
||||
|
||||
ret = switch_core_destroy();
|
||||
|
||||
destroy_status = switch_core_destroy();
|
||||
|
||||
switch_file_close(fd);
|
||||
|
||||
if (unlink(pid_path) != 0) {
|
||||
fprintf(stderr, "Failed to delete pid file [%s]\n", pid_path);
|
||||
}
|
||||
|
||||
if (destroy_status == SWITCH_STATUS_RESTART) {
|
||||
printf("WTF\n");
|
||||
execv(argv[0], argv);
|
||||
ret = 0;
|
||||
}
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user