From: Marc Olivier Chouinard Date: Tue, 1 Feb 2011 06:33:08 +0000 (-0500) Subject: switch_xml: Fix a lock on reloadxml when stderr write is blocked. Also remove an... X-Git-Tag: v1.2-rc1~187^2~17^2~21^2 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=2d6161e889fdaf8b03608fefdd7ef480a56ddf8b;p=thirdparty%2Ffreeswitch.git switch_xml: Fix a lock on reloadxml when stderr write is blocked. Also remove an error parsing print since reason generated were wrong and duplicate. --- diff --git a/src/switch_xml.c b/src/switch_xml.c index fe6a19949d..964a7694b2 100644 --- a/src/switch_xml.c +++ b/src/switch_xml.c @@ -1286,9 +1286,7 @@ static int preprocess_glob(const char *cwd, const char *pattern, int write_fd, i } 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; } @@ -1299,11 +1297,9 @@ static int preprocess_glob(const char *cwd, const char *pattern, int write_fd, i *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); }