aboutsummaryrefslogtreecommitdiffstats
path: root/cdr
diff options
context:
space:
mode:
authorkpfleming <kpfleming@f38db490-d61c-443f-a65b-d21fe96a405b>2007-06-14 22:09:20 +0000
committerkpfleming <kpfleming@f38db490-d61c-443f-a65b-d21fe96a405b>2007-06-14 22:09:20 +0000
commit4c5507d166332e73d2e7b63bd97a03c76172d923 (patch)
tree9bccdddefcc0defe7b34185794b77a9439806dcd /cdr
parent4293ad87778af581f153f9f651126de6a20e7704 (diff)
Merged revisions 69392 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4 ........ r69392 | kpfleming | 2007-06-14 16:50:40 -0500 (Thu, 14 Jun 2007) | 2 lines use ast_localtime() in every place localtime_r() was being used ........ git-svn-id: http://svn.digium.com/svn/asterisk/trunk@69405 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 cbfe80fd0..f40f555a8 100644
--- a/cdr/cdr_csv.c
+++ b/cdr/cdr_csv.c
@@ -200,7 +200,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 56f0cda35..d9b1cbb9e 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 0b62440a8..09df1bfd7 100644
--- a/cdr/cdr_pgsql.c
+++ b/cdr/cdr_pgsql.c
@@ -78,7 +78,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 ff380a13a..c41d680dd 100644
--- a/cdr/cdr_radius.c
+++ b/cdr/cdr_radius.c
@@ -146,7 +146,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;
@@ -155,7 +155,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;
@@ -164,7 +164,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 b47dd350c..52010ad93 100644
--- a/cdr/cdr_sqlite.c
+++ b/cdr/cdr_sqlite.c
@@ -104,15 +104,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 3f79fc637..451bf1440 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);
}