aboutsummaryrefslogtreecommitdiffstats
path: root/logger.c
diff options
context:
space:
mode:
authorjeremy <jeremy@f38db490-d61c-443f-a65b-d21fe96a405b>2004-01-12 06:32:40 +0000
committerjeremy <jeremy@f38db490-d61c-443f-a65b-d21fe96a405b>2004-01-12 06:32:40 +0000
commit13ab05db0c47269b3bf04b197598aeecb82904a2 (patch)
tree485b498c3819ba4563784d04ce17d6393e7bfed1 /logger.c
parent93f38889ccd131c88e2235a30282c42c2caf8c52 (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-xlogger.c31
1 files changed, 10 insertions, 21 deletions
diff --git a/logger.c b/logger.c
index d6fa6ab97..8b30d534b 100755
--- a/logger.c
+++ b/logger.c
@@ -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);