diff options
author | oej <oej@f38db490-d61c-443f-a65b-d21fe96a405b> | 2007-12-06 12:54:11 +0000 |
---|---|---|
committer | oej <oej@f38db490-d61c-443f-a65b-d21fe96a405b> | 2007-12-06 12:54:11 +0000 |
commit | 143bc3f5c3591f6f4bc00d0a505212eb40405cfd (patch) | |
tree | 689ab17363559d30e43abdbd34691727b9713c81 /main/logger.c | |
parent | bd43e29d956d5dab0c3f8d417863ee04368fc9a9 (diff) |
Make sure logger is reloaded at general reload in the cli.
(Discovered during Asterisk training in Portugal)
git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.4@91366 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'main/logger.c')
-rw-r--r-- | main/logger.c | 20 |
1 files changed, 14 insertions, 6 deletions
diff --git a/main/logger.c b/main/logger.c index 50d8ca1ab..79ff8deaf 100644 --- a/main/logger.c +++ b/main/logger.c @@ -483,13 +483,21 @@ int reload_logger(int rotate) return res; } +/*! \brief Reload the logger module without rotating log files (also used from loader.c during + a full Asterisk reload) */ +int logger_reload(void) +{ + if(reload_logger(0)) + return RESULT_FAILURE; + return RESULT_SUCCESS; +} + static int handle_logger_reload(int fd, int argc, char *argv[]) { - if(reload_logger(0)) { + int result = logger_reload(); + if (result == RESULT_FAILURE) ast_cli(fd, "Failed to reload the logger\n"); - return RESULT_FAILURE; - } else - return RESULT_SUCCESS; + return result; } static int handle_logger_rotate(int fd, int argc, char *argv[]) @@ -497,8 +505,8 @@ static int handle_logger_rotate(int fd, int argc, char *argv[]) if(reload_logger(1)) { ast_cli(fd, "Failed to reload the logger and rotate log files\n"); return RESULT_FAILURE; - } else - return RESULT_SUCCESS; + } + return RESULT_SUCCESS; } /*! \brief CLI command to show logging system configuration */ |