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/triton | |
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/triton')
-rw-r--r-- | accel-pppd/triton/log.c | 1 | ||||
-rw-r--r-- | accel-pppd/triton/triton.h | 8 |
2 files changed, 8 insertions, 1 deletions
diff --git a/accel-pppd/triton/log.c b/accel-pppd/triton/log.c index 9226e11..668d9e9 100644 --- a/accel-pppd/triton/log.c +++ b/accel-pppd/triton/log.c @@ -1,5 +1,6 @@ #include <stdio.h> #include <stdarg.h> +#include <sys/time.h> #include "triton_p.h" diff --git a/accel-pppd/triton/triton.h b/accel-pppd/triton/triton.h index af42a19..3c02db2 100644 --- a/accel-pppd/triton/triton.h +++ b/accel-pppd/triton/triton.h @@ -1,7 +1,7 @@ #ifndef TRITON_H #define TRITON_H -#include <sys/time.h> +#include <time.h> #include <stdint.h> #include "list.h" @@ -110,6 +110,12 @@ int triton_module_loaded(const char *name); void triton_register_init(int order, void (*func)(void)); +static inline time_t _time() +{ + struct timespec ts; + clock_gettime(CLOCK_MONOTONIC, &ts); + return ts.tv_sec; +} #define TRITON_OK 0 #define TRITON_ERR_NOCOMP -1 |