diff options
author | jeremy <jeremy@f38db490-d61c-443f-a65b-d21fe96a405b> | 2004-01-12 06:32:40 +0000 |
---|---|---|
committer | jeremy <jeremy@f38db490-d61c-443f-a65b-d21fe96a405b> | 2004-01-12 06:32:40 +0000 |
commit | 13ab05db0c47269b3bf04b197598aeecb82904a2 (patch) | |
tree | 485b498c3819ba4563784d04ce17d6393e7bfed1 /logger.c | |
parent | 93f38889ccd131c88e2235a30282c42c2caf8c52 (diff) |
remove code that could never be executed (tautological truth test) Bug #800
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@1977 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'logger.c')
-rwxr-xr-x | logger.c | 31 |
1 files changed, 10 insertions, 21 deletions
@@ -420,20 +420,15 @@ void ast_log(int level, const char *file, int line, const char *function, const if (level == __LOG_EVENT) { time(&t); localtime_r(&t,&tm); - if (&tm) { - /* Log events into the event log file, with a different format */ - strftime(date, sizeof(date), "%b %e %T", &tm); - va_start(ap, fmt); - - fprintf(eventlog, "%s asterisk[%d]: ", date, getpid()); - vfprintf(eventlog, fmt, ap); - fflush(eventlog); - - va_end(ap); - } else - /** Cannot use ast_log() from locked section of ast_log()! - ast_log(LOG_WARNING, "Unable to retrieve local time?\n"); **/ - fprintf(stderr, "ast_log: Unable to retrieve local time for %ld?\n", (long)t); + /* Log events into the event log file, with a different format */ + strftime(date, sizeof(date), "%b %e %T", &tm); + va_start(ap, fmt); + + fprintf(eventlog, "%s asterisk[%d]: ", date, getpid()); + vfprintf(eventlog, fmt, ap); + fflush(eventlog); + + va_end(ap); ast_mutex_unlock(&loglock); return; } @@ -451,13 +446,7 @@ void ast_log(int level, const char *file, int line, const char *function, const time(&t); localtime_r(&t, &tm); - if(!&tm) { - /** Cannot use ast_log() from locked section of ast_log()! - ast_log(AST_LOG_WARNING, "Unable to retrieve local time?\n"); **/ - fprintf(stderr, "ast_log: Unable to retrieve local time for %ld?\n", (long)t); - ast_mutex_unlock(&loglock); - return; - } + strftime(date, sizeof(date), "%b %e %T", &tm); sprintf(linestr, "%d", line); |