]> git.ipfire.org Git - thirdparty/asterisk.git/commitdiff
Portability fix for devmode compiling (closes bug #10382)
authorTilghman Lesher <tilghman@meg.abyt.es>
Sun, 5 Aug 2007 14:18:00 +0000 (14:18 +0000)
committerTilghman Lesher <tilghman@meg.abyt.es>
Sun, 5 Aug 2007 14:18:00 +0000 (14:18 +0000)
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@78146 65c4cc65-6c06-0410-ace0-fbb531ad65f3

cdr/cdr_pgsql.c

index 205e40e79bf89eed0652301b800bf286e675f72b..ee115ac488d1ca9ce3cc8db1506c8ba6a64c8f5e 100644 (file)
@@ -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) {