summaryrefslogtreecommitdiff
path: root/accel-pppd/cli
diff options
context:
space:
mode:
authorKozlov Dmitry <dima@server>2011-08-19 14:04:55 +0400
committerKozlov Dmitry <dima@server>2011-08-19 14:04:55 +0400
commit5ef49162ea9763ca9878c22e3736766d8f1db014 (patch)
treef58da9adfc87ece6c608265fc694e66bd5db162c /accel-pppd/cli
parentfd52e4578dcc7de2301480fece9395563d643045 (diff)
downloadaccel-ppp-xebd-5ef49162ea9763ca9878c22e3736766d8f1db014.tar.gz
accel-ppp-xebd-5ef49162ea9763ca9878c22e3736766d8f1db014.zip
snmp support
Diffstat (limited to 'accel-pppd/cli')
-rw-r--r--accel-pppd/cli/std_cmd.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/accel-pppd/cli/std_cmd.c b/accel-pppd/cli/std_cmd.c
index e24b3fa..1c8e149 100644
--- a/accel-pppd/cli/std_cmd.c
+++ b/accel-pppd/cli/std_cmd.c
@@ -16,6 +16,7 @@
static int show_stat_exec(const char *cmd, char * const *fields, int fields_cnt, void *client)
{
+ struct timespec ts;
time_t dt;
int day,hour;
char statm_fname[128];
@@ -33,8 +34,8 @@ static int show_stat_exec(const char *cmd, char * const *fields, int fields_cnt,
fclose(f);
}
- time(&dt);
- dt -= triton_stat.start_time;
+ clock_gettime(CLOCK_MONOTONIC, &ts);
+ dt = ts.tv_sec - triton_stat.start_time;
day = dt / (60 * 60 * 24);
dt %= 60 * 60 * 24;
hour = dt / (60 * 60);