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:
Anthony Minessale
2008-10-02 16:46:20 +00:00
parent 3c2699ec2a
commit f23c88d9fa
4 changed files with 54 additions and 8 deletions
+9 -2
View File
@@ -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;
}