remove code that could never be executed (tautological truth test) Bug #800
authorJeremy McNamara <jj@nufone.net>
Mon, 12 Jan 2004 06:32:40 +0000 (06:32 +0000)
committerJeremy McNamara <jj@nufone.net>
Mon, 12 Jan 2004 06:32:40 +0000 (06:32 +0000)
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@1977 65c4cc65-6c06-0410-ace0-fbb531ad65f3

logger.c

index d6fa6ab..8b30d53 100755 (executable)
--- 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);