summaryrefslogtreecommitdiff
path: root/accel-pppd/radius/acct.c
diff options
context:
space:
mode:
authorKozlov Dmitry <xeb@mail.ru>2011-09-05 15:33:28 +0400
committerKozlov Dmitry <xeb@mail.ru>2011-09-05 15:33:28 +0400
commit8a0f7065300efbe6e916ec7e2a298dc8feec1298 (patch)
tree0c2d2931cbf1eedfac073f3ef11ae6aef683c127 /accel-pppd/radius/acct.c
parent3e6a720a2cbd08edb6d04255b2246a833df6825c (diff)
downloadaccel-ppp-8a0f7065300efbe6e916ec7e2a298dc8feec1298.tar.gz
accel-ppp-8a0f7065300efbe6e916ec7e2a298dc8feec1298.zip
radius: use clock_gettime(CLOCK_MONOTONIC) instead of gettimeofday
Diffstat (limited to 'accel-pppd/radius/acct.c')
-rw-r--r--accel-pppd/radius/acct.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/accel-pppd/radius/acct.c b/accel-pppd/radius/acct.c
index 6f948614..a75eff41 100644
--- a/accel-pppd/radius/acct.c
+++ b/accel-pppd/radius/acct.c
@@ -102,7 +102,7 @@ static int rad_acct_read(struct triton_md_handler_t *h)
return 0;
dt = (req->reply->tv.tv_sec - req->pack->tv.tv_sec) * 1000 +
- (req->reply->tv.tv_usec - req->pack->tv.tv_usec) / 1000;
+ (req->reply->tv.tv_nsec - req->pack->tv.tv_nsec) / 1000000;
stat_accm_add(req->serv->stat_interim_query_1m, dt);
stat_accm_add(req->serv->stat_interim_query_5m, dt);
@@ -293,7 +293,7 @@ int rad_acct_start(struct radius_pd_t *rpd)
}
dt = (rpd->acct_req->reply->tv.tv_sec - rpd->acct_req->pack->tv.tv_sec) * 1000 +
- (rpd->acct_req->reply->tv.tv_usec - rpd->acct_req->pack->tv.tv_usec) / 1000;
+ (rpd->acct_req->reply->tv.tv_nsec - rpd->acct_req->pack->tv.tv_nsec) / 1000000;
stat_accm_add(rpd->acct_req->serv->stat_acct_query_1m, dt);
stat_accm_add(rpd->acct_req->serv->stat_acct_query_5m, dt);
@@ -433,7 +433,7 @@ void rad_acct_stop(struct radius_pd_t *rpd)
}
dt = (rpd->acct_req->reply->tv.tv_sec - rpd->acct_req->pack->tv.tv_sec) * 1000 +
- (rpd->acct_req->reply->tv.tv_usec - rpd->acct_req->pack->tv.tv_usec) / 1000;
+ (rpd->acct_req->reply->tv.tv_nsec - rpd->acct_req->pack->tv.tv_nsec) / 1000000;
stat_accm_add(rpd->acct_req->serv->stat_acct_query_1m, dt);
stat_accm_add(rpd->acct_req->serv->stat_acct_query_5m, dt);