diff --git a/src/switch.c b/src/switch.c index 26ccfdb721..aad686981a 100644 --- a/src/switch.c +++ b/src/switch.c @@ -269,7 +269,7 @@ int main(int argc, char *argv[]) int known_opt; int high_prio = 0; switch_core_flag_t flags = SCF_USE_SQL; - int ret; + int ret = 0; switch_status_t destroy_status; switch_file_t *fd; switch_memory_pool_t *pool = NULL; @@ -617,8 +617,7 @@ int main(int argc, char *argv[]) } if (destroy_status == SWITCH_STATUS_RESTART) { - execv(argv[0], argv); - ret = 0; + ret = execv(argv[0], argv); } return ret;