Eliminate localtime calls, various cleanups

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@723 65c4cc65-6c06-0410-ace0-fbb531ad65f3
This commit is contained in:
Mark Spencer
2003-03-31 03:19:34 +00:00
parent e6918cb42e
commit 9baba73625
11 changed files with 91 additions and 100 deletions

View File

@@ -38,7 +38,7 @@ static MYSQL *mysql;
static int mysql_log(struct ast_cdr *cdr)
{
struct tm *tm;
struct tm tm;
struct timeval tv;
struct timezone tz;
char *sqlcmd, timestr[128];
@@ -51,8 +51,8 @@ static int mysql_log(struct ast_cdr *cdr)
gettimeofday(&tv,&tz);
t = tv.tv_sec;
tm = localtime(&t);
strftime(timestr,128,DATE_FORMAT,tm);
localtime_r(&t,&tm);
strftime(timestr,128,DATE_FORMAT,&tm);
ast_log(LOG_DEBUG,"cdr_mysql: inserting a CDR record.\n");