aboutsummaryrefslogtreecommitdiffstats
path: root/main
diff options
context:
space:
mode:
authortilghman <tilghman@f38db490-d61c-443f-a65b-d21fe96a405b>2010-07-25 17:32:21 +0000
committertilghman <tilghman@f38db490-d61c-443f-a65b-d21fe96a405b>2010-07-25 17:32:21 +0000
commitd2a915204ae5f232a918dc6b53b04d20a5dfb0f6 (patch)
tree66d1e86775b090e1e447e2d0b66cdc36055d39b1 /main
parent3b2289e38ffe6f6b3feec37ce1a5a525d852d331 (diff)
Don't assume qlog is open.
(closes issue #17704) Reported by: vrban Patches: issue17704.patch uploaded by pabelanger (license 224) Tested by: vrban git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.8@279390 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'main')
-rw-r--r--main/logger.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/main/logger.c b/main/logger.c
index 3a28d42b8..304c03a90 100644
--- a/main/logger.c
+++ b/main/logger.c
@@ -690,9 +690,10 @@ static int reload_logger(int rotate)
break;
}
}
-
- fclose(qlog);
- qlog = NULL;
+ if (qlog) {
+ fclose(qlog);
+ qlog = NULL;
+ }
snprintf(old, sizeof(old), "%s/%s", ast_config_AST_LOG_DIR, queue_log_name);
if (queue_rotate) {
rotate_file(old);
@@ -720,8 +721,9 @@ static int reload_logger(int rotate)
a full Asterisk reload) */
int logger_reload(void)
{
- if(reload_logger(0))
+ if (reload_logger(0)) {
return RESULT_FAILURE;
+ }
return RESULT_SUCCESS;
}