aboutsummaryrefslogtreecommitdiffstats
path: root/cdr
diff options
context:
space:
mode:
authorkpfleming <kpfleming@f38db490-d61c-443f-a65b-d21fe96a405b>2007-06-14 21:50:40 +0000
committerkpfleming <kpfleming@f38db490-d61c-443f-a65b-d21fe96a405b>2007-06-14 21:50:40 +0000
commita45f0ce8a0fded7acff845122856b8b92e8a1e00 (patch)
tree970b4536445781a1e3046fb0f2fc3c1d10eab080 /cdr
parenteaff648d9b225be366870aade0617c6d8ca2a121 (diff)
use ast_localtime() in every place localtime_r() was being used
git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.4@69392 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'cdr')
-rw-r--r--cdr/cdr_csv.c2
-rw-r--r--cdr/cdr_manager.c6
-rw-r--r--cdr/cdr_odbc.c2
-rw-r--r--cdr/cdr_pgsql.c2
-rw-r--r--cdr/cdr_radius.c6
-rw-r--r--cdr/cdr_sqlite.c6
-rw-r--r--cdr/cdr_tds.c2
7 files changed, 13 insertions, 13 deletions
diff --git a/cdr/cdr_csv.c b/cdr/cdr_csv.c
index 350620315..5475398ac 100644
--- a/cdr/cdr_csv.c
+++ b/cdr/cdr_csv.c
@@ -199,7 +199,7 @@ static int append_date(char *buf, struct timeval tv, size_t bufsize)
if (usegmtime) {
gmtime_r(&t,&tm);
} else {
- localtime_r(&t,&tm);
+ ast_localtime(&t, &tm, NULL);
}
strftime(tmp, sizeof(tmp), DATE_FORMAT, &tm);
return append_string(buf, tmp, bufsize);
diff --git a/cdr/cdr_manager.c b/cdr/cdr_manager.c
index bd6ef6709..352d7d400 100644
--- a/cdr/cdr_manager.c
+++ b/cdr/cdr_manager.c
@@ -95,17 +95,17 @@ static int manager_log(struct ast_cdr *cdr)
return 0;
t = cdr->start.tv_sec;
- localtime_r(&t, &timeresult);
+ ast_localtime(&t, &timeresult, NULL);
strftime(strStartTime, sizeof(strStartTime), DATE_FORMAT, &timeresult);
if (cdr->answer.tv_sec) {
t = cdr->answer.tv_sec;
- localtime_r(&t, &timeresult);
+ ast_localtime(&t, &timeresult, NULL);
strftime(strAnswerTime, sizeof(strAnswerTime), DATE_FORMAT, &timeresult);
}
t = cdr->end.tv_sec;
- localtime_r(&t, &timeresult);
+ ast_localtime(&t, &timeresult, NULL);
strftime(strEndTime, sizeof(strEndTime), DATE_FORMAT, &timeresult);
manager_event(EVENT_FLAG_CALL, "Cdr",
diff --git a/cdr/cdr_odbc.c b/cdr/cdr_odbc.c
index db93eac55..4afda0e8e 100644
--- a/cdr/cdr_odbc.c
+++ b/cdr/cdr_odbc.c
@@ -99,7 +99,7 @@ static int odbc_log(struct ast_cdr *cdr)
if (usegmtime)
gmtime_r(&cdr->start.tv_sec,&tm);
else
- localtime_r(&cdr->start.tv_sec,&tm);
+ ast_localtime(&cdr->start.tv_sec, &tm, NULL);
ast_mutex_lock(&odbc_lock);
strftime(timestr, sizeof(timestr), DATE_FORMAT, &tm);
diff --git a/cdr/cdr_pgsql.c b/cdr/cdr_pgsql.c
index dd43b45ba..7788cf037 100644
--- a/cdr/cdr_pgsql.c
+++ b/cdr/cdr_pgsql.c
@@ -77,7 +77,7 @@ static int pgsql_log(struct ast_cdr *cdr)
ast_mutex_lock(&pgsql_lock);
- localtime_r(&cdr->start.tv_sec,&tm);
+ ast_localtime(&cdr->start.tv_sec, &tm, NULL);
strftime(timestr, sizeof(timestr), DATE_FORMAT, &tm);
if ((!connected) && pghostname && pgdbuser && pgpassword && pgdbname) {
diff --git a/cdr/cdr_radius.c b/cdr/cdr_radius.c
index 9f9a4470a..6d890e764 100644
--- a/cdr/cdr_radius.c
+++ b/cdr/cdr_radius.c
@@ -145,7 +145,7 @@ static int build_radius_record(VALUE_PAIR **send, struct ast_cdr *cdr)
if (ast_test_flag(&global_flags, RADIUS_FLAG_USEGMTIME))
gmtime_r(&(cdr->start.tv_sec), &tm);
else
- localtime_r(&(cdr->start.tv_sec), &tm);
+ ast_localtime(&(cdr->start.tv_sec), &tm, NULL);
strftime(timestr, sizeof(timestr), DATE_FORMAT, &tm);
if (!rc_avpair_add(rh, send, PW_AST_START_TIME, timestr, strlen(timestr), VENDOR_CODE))
return -1;
@@ -154,7 +154,7 @@ static int build_radius_record(VALUE_PAIR **send, struct ast_cdr *cdr)
if (ast_test_flag(&global_flags, RADIUS_FLAG_USEGMTIME))
gmtime_r(&(cdr->answer.tv_sec), &tm);
else
- localtime_r(&(cdr->answer.tv_sec), &tm);
+ ast_localtime(&(cdr->answer.tv_sec), &tm, NULL);
strftime(timestr, sizeof(timestr), DATE_FORMAT, &tm);
if (!rc_avpair_add(rh, send, PW_AST_ANSWER_TIME, timestr, strlen(timestr), VENDOR_CODE))
return -1;
@@ -163,7 +163,7 @@ static int build_radius_record(VALUE_PAIR **send, struct ast_cdr *cdr)
if (ast_test_flag(&global_flags, RADIUS_FLAG_USEGMTIME))
gmtime_r(&(cdr->end.tv_sec), &tm);
else
- localtime_r(&(cdr->end.tv_sec), &tm);
+ ast_localtime(&(cdr->end.tv_sec), &tm, NULL);
strftime(timestr, sizeof(timestr), DATE_FORMAT, &tm);
if (!rc_avpair_add(rh, send, PW_AST_END_TIME, timestr, strlen(timestr), VENDOR_CODE))
return -1;
diff --git a/cdr/cdr_sqlite.c b/cdr/cdr_sqlite.c
index 146f7a209..5aa8a5154 100644
--- a/cdr/cdr_sqlite.c
+++ b/cdr/cdr_sqlite.c
@@ -101,15 +101,15 @@ static int sqlite_log(struct ast_cdr *cdr)
ast_mutex_lock(&sqlite_lock);
t = cdr->start.tv_sec;
- localtime_r(&t, &tm);
+ ast_localtime(&t, &tm, NULL);
strftime(startstr, sizeof(startstr), DATE_FORMAT, &tm);
t = cdr->answer.tv_sec;
- localtime_r(&t, &tm);
+ ast_localtime(&t, &tm, NULL);
strftime(answerstr, sizeof(answerstr), DATE_FORMAT, &tm);
t = cdr->end.tv_sec;
- localtime_r(&t, &tm);
+ ast_localtime(&t, &tm, NULL);
strftime(endstr, sizeof(endstr), DATE_FORMAT, &tm);
for(count=0; count<5; count++) {
diff --git a/cdr/cdr_tds.c b/cdr/cdr_tds.c
index 2ac8481a8..444751d1a 100644
--- a/cdr/cdr_tds.c
+++ b/cdr/cdr_tds.c
@@ -286,7 +286,7 @@ static void get_date(char *dateField, struct timeval tv)
if (!ast_tvzero(tv))
{
t = tv.tv_sec;
- localtime_r(&t, &tm);
+ ast_localtime(&t, &tm, NULL);
strftime(buf, 80, DATE_FORMAT, &tm);
sprintf(dateField, "'%s'", buf);
}