diff options
author | Dmitry Kozlov <xeb@mail.ru> | 2014-10-03 21:59:07 +0400 |
---|---|---|
committer | Dmitry Kozlov <xeb@mail.ru> | 2014-10-03 21:59:07 +0400 |
commit | 9994d48250e3805565f709d39ea0de4877436c6c (patch) | |
tree | 23ef90295715bb672a80da7fb1c7f9614cb2375e /accel-pppd/radius | |
parent | 8a7290359a446ce04c468b2a598ca75a6e2a9611 (diff) | |
download | accel-ppp-9994d48250e3805565f709d39ea0de4877436c6c.tar.gz accel-ppp-9994d48250e3805565f709d39ea0de4877436c6c.zip |
get rid of time(), use clock_gettime(CLOCK_MONOTONIC) instead
Diffstat (limited to 'accel-pppd/radius')
-rw-r--r-- | accel-pppd/radius/acct.c | 2 | ||||
-rw-r--r-- | accel-pppd/radius/radius.c | 7 |
2 files changed, 3 insertions, 6 deletions
diff --git a/accel-pppd/radius/acct.c b/accel-pppd/radius/acct.c index f991945..c4b37cd 100644 --- a/accel-pppd/radius/acct.c +++ b/accel-pppd/radius/acct.c @@ -161,7 +161,7 @@ static void rad_acct_interim_update(struct triton_timer_t *t) return; if (rpd->session_timeout.expire_tv.tv_sec && - rpd->session_timeout.expire_tv.tv_sec - (time(NULL) - rpd->ses->start_time) < INTERIM_SAFE_TIME) + rpd->session_timeout.expire_tv.tv_sec - (_time() - rpd->ses->start_time) < INTERIM_SAFE_TIME) return; if (req_set_stat(rpd->acct_req, rpd->ses)) { diff --git a/accel-pppd/radius/radius.c b/accel-pppd/radius/radius.c index c94769c..fa2b6a6 100644 --- a/accel-pppd/radius/radius.c +++ b/accel-pppd/radius/radius.c @@ -277,16 +277,13 @@ static void session_timeout(struct triton_timer_t *t) static void idle_timeout(struct triton_timer_t *t) { struct radius_pd_t *rpd = container_of(t, typeof(*rpd), idle_timeout); - time_t tt; - + if (rpd->ses->stop_time) return; - time(&tt); - ap_session_read_stats(rpd->ses, NULL); - if (tt - rpd->ses->idle_time > t->period / 1000) { + if (_time() - rpd->ses->idle_time > t->period / 1000) { log_ppp_msg("radius: idle timed out\n"); ap_session_terminate(rpd->ses, TERM_IDLE_TIMEOUT, 0); } |