diff options
Diffstat (limited to 'networking')
-rw-r--r-- | networking/isrv.c | 18 |
1 files changed, 2 insertions, 16 deletions
diff --git a/networking/isrv.c b/networking/isrv.c index 1a41dd4fb..080c60fbd 100644 --- a/networking/isrv.c +++ b/networking/isrv.c | |||
@@ -21,20 +21,6 @@ | |||
21 | 21 | ||
22 | /* Helpers */ | 22 | /* Helpers */ |
23 | 23 | ||
24 | /* Even if _POSIX_MONOTONIC_CLOCK is defined, this | ||
25 | * may require librt */ | ||
26 | #if 0 /*def _POSIX_MONOTONIC_CLOCK*/ | ||
27 | static time_t monotonic_time(void) | ||
28 | { | ||
29 | struct timespec ts; | ||
30 | if (clock_gettime(CLOCK_MONOTONIC, &ts) != 0) | ||
31 | time(&ts.tv_sec); | ||
32 | return ts.tv_sec; | ||
33 | } | ||
34 | #else | ||
35 | #define monotonic_time() (time(NULL)) | ||
36 | #endif | ||
37 | |||
38 | /* Opaque structure */ | 24 | /* Opaque structure */ |
39 | 25 | ||
40 | struct isrv_state_t { | 26 | struct isrv_state_t { |
@@ -258,7 +244,7 @@ static void handle_fd_set(isrv_state_t *state, fd_set *fds, int (*h)(int, void * | |||
258 | /* this peer is gone */ | 244 | /* this peer is gone */ |
259 | remove_peer(state, peer); | 245 | remove_peer(state, peer); |
260 | } else if (TIMEOUT) { | 246 | } else if (TIMEOUT) { |
261 | TIMEO_TBL[peer] = monotonic_time(); | 247 | TIMEO_TBL[peer] = monotonic_sec(); |
262 | } | 248 | } |
263 | } | 249 | } |
264 | } | 250 | } |
@@ -335,7 +321,7 @@ void isrv_run( | |||
335 | break; | 321 | break; |
336 | 322 | ||
337 | if (timeout) { | 323 | if (timeout) { |
338 | time_t t = monotonic_time(); | 324 | time_t t = monotonic_sec(); |
339 | if (t != CURTIME) { | 325 | if (t != CURTIME) { |
340 | CURTIME = t; | 326 | CURTIME = t; |
341 | handle_timeout(state, do_timeout); | 327 | handle_timeout(state, do_timeout); |