From 5ef49162ea9763ca9878c22e3736766d8f1db014 Mon Sep 17 00:00:00 2001 From: Kozlov Dmitry Date: Fri, 19 Aug 2011 14:04:55 +0400 Subject: snmp support --- accel-pppd/cli/std_cmd.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'accel-pppd/cli') diff --git a/accel-pppd/cli/std_cmd.c b/accel-pppd/cli/std_cmd.c index e24b3fa0..1c8e149f 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); -- cgit v1.2.3