int j = 0;
switch_sleep(1000000);
- if (!argv || execv(argv[0], argv) == -1) {
+ if (!argv || !argv[0] || 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]);
}
}
+ switch_assert(app != NULL);
if (!strncasecmp(app, "perl", 4)) {
bg++;
}
SWITCH_DECLARE(FILE *) switch_core_data_channel(switch_text_channel_t channel)
{
- FILE *handle = stdout;
-
- switch (channel) {
- case SWITCH_CHANNEL_ID_LOG:
- case SWITCH_CHANNEL_ID_LOG_CLEAN:
- handle = runtime.console;
- break;
- default:
- handle = runtime.console;
- break;
- }
-
- return handle;
+ return runtime.console;
}
case SCSC_DEBUG_LEVEL:
if (oldintval > -1) {
if (oldintval > 10)
- newintval = 10;
+ oldintval = 10;
runtime.debug_level = oldintval;
}
newintval = runtime.debug_level;
switch_file_t *newfile;
switch_size_t size = 0;
+ switch_assert(string);
+
status = switch_file_open(&newfile, fh->spool_path ? fh->spool_path : fh->file_path, SWITCH_FOPEN_READ, SWITCH_FPROT_OS_DEFAULT, fh->memory_pool);
if (status != SWITCH_STATUS_SUCCESS) {