From 34f8812c64a003e2a85e94c0d821204f563736c8 Mon Sep 17 00:00:00 2001 From: Tilghman Lesher Date: Sun, 5 Aug 2007 14:18:00 +0000 Subject: [PATCH] Portability fix for devmode compiling (closes bug #10382) git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@78146 65c4cc65-6c06-0410-ace0-fbb531ad65f3 --- cdr/cdr_pgsql.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/cdr/cdr_pgsql.c b/cdr/cdr_pgsql.c index 205e40e79b..ee115ac488 100644 --- a/cdr/cdr_pgsql.c +++ b/cdr/cdr_pgsql.c @@ -71,13 +71,14 @@ static PGconn *conn = NULL; static int pgsql_log(struct ast_cdr *cdr) { struct tm tm; + time_t t = cdr->start.tv_sec; char sqlcmd[2048] = "", timestr[128]; char *pgerror; PGresult *result; ast_mutex_lock(&pgsql_lock); - ast_localtime(&cdr->start.tv_sec, &tm, NULL); + ast_localtime(&t, &tm, NULL); strftime(timestr, sizeof(timestr), DATE_FORMAT, &tm); if ((!connected) && pghostname && pgdbuser && pgpassword && pgdbname) {