diff options
author | James Golovich <james@gnuinter.net> | 2004-07-09 16:19:00 +0000 |
---|---|---|
committer | James Golovich <james@gnuinter.net> | 2004-07-09 16:19:00 +0000 |
commit | 9e0e3799bf19c6c850fa1f5e8d93ffe2f0d4863c (patch) | |
tree | d44952c807ebd8206e2eaf4a2c38f76bed42461b /cdr/cdr_pgsql.c | |
parent | f107562f75ed000d9c43e80653b4619fe6c60e3b (diff) |
Fixes from bkw_. Formatting in app_db.c and handle start right in cdr_pgsql.c
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@3415 65c4cc65-6c06-0410-ace0-fbb531ad65f3
Diffstat (limited to 'cdr/cdr_pgsql.c')
-rwxr-xr-x | cdr/cdr_pgsql.c | 8 |
1 files changed, 2 insertions, 6 deletions
diff --git a/cdr/cdr_pgsql.c b/cdr/cdr_pgsql.c index 876ed7f8c..902136c04 100755 --- a/cdr/cdr_pgsql.c +++ b/cdr/cdr_pgsql.c @@ -49,18 +49,14 @@ PGresult *result; static int pgsql_log(struct ast_cdr *cdr) { struct tm tm; - struct timeval tv; char sqlcmd[2048], timestr[128]; - time_t t; - char *pgerror; + char *pgerror; ast_mutex_lock(&pgsql_lock); memset(sqlcmd,0,2048); - gettimeofday(&tv,NULL); - t = tv.tv_sec; - localtime_r(&t,&tm); + localtime_r(&cdr->start.tv_sec,&tm); strftime(timestr,128,DATE_FORMAT,&tm); if ((!connected) && pghostname && pgdbuser && pgpassword && pgdbname) { |