remove code that could never be executed (tautological truth test) Bug #800
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@1977 65c4cc65-6c06-0410-ace0-fbb531ad65f3
This commit is contained in:
parent
e08cce6b6b
commit
0c6adc08fc
27
logger.c
27
logger.c
|
@ -420,20 +420,15 @@ void ast_log(int level, const char *file, int line, const char *function, const
|
||||||
if (level == __LOG_EVENT) {
|
if (level == __LOG_EVENT) {
|
||||||
time(&t);
|
time(&t);
|
||||||
localtime_r(&t,&tm);
|
localtime_r(&t,&tm);
|
||||||
if (&tm) {
|
/* Log events into the event log file, with a different format */
|
||||||
/* Log events into the event log file, with a different format */
|
strftime(date, sizeof(date), "%b %e %T", &tm);
|
||||||
strftime(date, sizeof(date), "%b %e %T", &tm);
|
va_start(ap, fmt);
|
||||||
va_start(ap, fmt);
|
|
||||||
|
|
||||||
fprintf(eventlog, "%s asterisk[%d]: ", date, getpid());
|
fprintf(eventlog, "%s asterisk[%d]: ", date, getpid());
|
||||||
vfprintf(eventlog, fmt, ap);
|
vfprintf(eventlog, fmt, ap);
|
||||||
fflush(eventlog);
|
fflush(eventlog);
|
||||||
|
|
||||||
va_end(ap);
|
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);
|
|
||||||
ast_mutex_unlock(&loglock);
|
ast_mutex_unlock(&loglock);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
@ -451,13 +446,7 @@ void ast_log(int level, const char *file, int line, const char *function, const
|
||||||
|
|
||||||
time(&t);
|
time(&t);
|
||||||
localtime_r(&t, &tm);
|
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);
|
strftime(date, sizeof(date), "%b %e %T", &tm);
|
||||||
|
|
||||||
sprintf(linestr, "%d", line);
|
sprintf(linestr, "%d", line);
|
||||||
|
|
Loading…
Reference in New Issue