diff options
author | Tilghman Lesher <tilghman@meg.abyt.es> | 2007-08-16 21:09:46 +0000 |
---|---|---|
committer | Tilghman Lesher <tilghman@meg.abyt.es> | 2007-08-16 21:09:46 +0000 |
commit | 56b9568164b694a42e88f1f8a31012078b833203 (patch) | |
tree | 8fda811f62cb6ffb99847befb7b74b1519ea95ba /main/logger.c | |
parent | c0060cd99a0a318b504da4c13eee85f3b9043fdc (diff) |
Don't reload a configuration file if nothing has changed.
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@79747 65c4cc65-6c06-0410-ace0-fbb531ad65f3
Diffstat (limited to 'main/logger.c')
-rw-r--r-- | main/logger.c | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/main/logger.c b/main/logger.c index 209da2167..fff798aee 100644 --- a/main/logger.c +++ b/main/logger.c @@ -305,12 +305,16 @@ static struct logchannel *make_logchannel(char *channel, char *components, int l return chan; } -static void init_logger_chain(void) +static void init_logger_chain(int reload) { struct logchannel *chan; struct ast_config *cfg; struct ast_variable *var; const char *s; + struct ast_flags config_flags = { reload ? CONFIG_FLAG_FILEUNCHANGED : 0 }; + + if ((cfg = ast_config_load("logger.conf", config_flags)) == CONFIG_STATUS_FILEUNCHANGED) + return; /* delete our list of log channels */ AST_RWLIST_WRLOCK(&logchannels); @@ -323,8 +327,6 @@ static void init_logger_chain(void) /* close syslog */ closelog(); - cfg = ast_config_load("logger.conf"); - /* If no config file, we're fine, set default options. */ if (!cfg) { if (errno) @@ -454,7 +456,7 @@ int reload_logger(int rotate) filesize_reload_needed = 0; - init_logger_chain(); + init_logger_chain(1); if (logfiles.event_log) { snprintf(old, sizeof(old), "%s/%s", ast_config_AST_LOG_DIR, EVENTLOG); @@ -802,7 +804,7 @@ int init_logger(void) ast_mkdir(ast_config_AST_LOG_DIR, 0777); /* create log channels */ - init_logger_chain(); + init_logger_chain(0); /* create the eventlog */ if (logfiles.event_log) { |