remove pid file when failing to load modules
This commit is contained in:
parent
42d40227d9
commit
a8d1b80b83
|
@ -921,7 +921,10 @@ int main(int argc, char *argv[])
|
|||
switch_file_write(fd, pid_buffer, &pid_len);
|
||||
|
||||
if (switch_core_init_and_modload(flags, nc ? SWITCH_FALSE : SWITCH_TRUE, &err) != SWITCH_STATUS_SUCCESS) {
|
||||
fprintf(stderr, "Cannot Initialize [%s]\n", err);
|
||||
fprintf(stderr, "Cannot Initialize [%s], deleting pid file [%s]\n", err, pid_path);
|
||||
if (unlink(pid_path) != 0) {
|
||||
fprintf(stderr, "Failed to delete pid file [%s]\n", pid_path);
|
||||
}
|
||||
return 255;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue