forked from Mirrors/freeswitch
Handle null argv in switch.c
This commit is contained in:
parent
e2d67d4ead
commit
4f81e5942a
@ -1053,7 +1053,7 @@ int main(int argc, char *argv[])
|
||||
setrlimit(RLIMIT_STACK, &rlp);
|
||||
|
||||
apr_terminate();
|
||||
ret = (int) execv(argv[0], argv);
|
||||
if (argv) ret = (int) execv(argv[0], argv);
|
||||
|
||||
for (i = 0; i < argc; i++) {
|
||||
switch_snprintf(buf + strlen(buf), sizeof(buf) - strlen(buf), "%s ", argv[i]);
|
||||
@ -1215,7 +1215,7 @@ int main(int argc, char *argv[])
|
||||
int j = 0;
|
||||
|
||||
switch_sleep(1000000);
|
||||
if (execv(argv[0], argv) == -1) {
|
||||
if (!argv || execv(argv[0], argv) == -1) {
|
||||
fprintf(stderr, "Restart Failed [%s] resorting to plan b\n", strerror(errno));
|
||||
for (j = 0; j < argc; j++) {
|
||||
switch_snprintf(buf + strlen(buf), sizeof(buf) - strlen(buf), "%s ", argv[j]);
|
||||
|
Loading…
Reference in New Issue
Block a user