diff options
author | Kozlov Dmitry <dima@server> | 2011-08-19 14:04:55 +0400 |
---|---|---|
committer | Kozlov Dmitry <dima@server> | 2011-08-19 14:04:55 +0400 |
commit | 5ef49162ea9763ca9878c22e3736766d8f1db014 (patch) | |
tree | f58da9adfc87ece6c608265fc694e66bd5db162c /accel-pppd/cli | |
parent | fd52e4578dcc7de2301480fece9395563d643045 (diff) | |
download | accel-ppp-5ef49162ea9763ca9878c22e3736766d8f1db014.tar.gz accel-ppp-5ef49162ea9763ca9878c22e3736766d8f1db014.zip |
snmp support
Diffstat (limited to 'accel-pppd/cli')
-rw-r--r-- | accel-pppd/cli/std_cmd.c | 5 |
1 files changed, 3 insertions, 2 deletions
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); |