}
if (glob(pattern, GLOB_NOCHECK, NULL, &glob_data) != 0) {
- if (stderr) {
- fprintf(stderr, "Error including %s\n", pattern);
- }
+ switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Error including %s\n", pattern);
goto end;
}
*e = '\0';
}
if (preprocess(dir_path, glob_data.gl_pathv[n], write_fd, rlevel) < 0) {
- const char *reason = strerror(errno);
if (rlevel > 100) {
- reason = "Maximum recursion limit reached";
+ switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Error including %s (Maximum recursion limit reached)\n", pattern);
}
- fprintf(stderr, "Error including %s (%s)\n", pattern, reason);
}
free(dir_path);
}