diff options
author | Jeremie Courreges-Anglas <jca@cvs.openbsd.org> | 2017-12-05 20:31:46 +0000 |
---|---|---|
committer | Jeremie Courreges-Anglas <jca@cvs.openbsd.org> | 2017-12-05 20:31:46 +0000 |
commit | 44af7db6048e7327fcbf501407443c0cdc90c7eb (patch) | |
tree | a2c1c91be4138d4f8655a5adedb8d35e522a1170 /sbin/isakmpd/pf_key_v2.c | |
parent | 592710a2059adb8aacec869dacfbaca0d473fc0b (diff) |
Use clock_gettime(CLOCK_MONOTONIC) to schedule timers
From Scott Cheloha, ok tb@
Diffstat (limited to 'sbin/isakmpd/pf_key_v2.c')
-rw-r--r-- | sbin/isakmpd/pf_key_v2.c | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/sbin/isakmpd/pf_key_v2.c b/sbin/isakmpd/pf_key_v2.c index 606ff3bb648..9194cd7fb0e 100644 --- a/sbin/isakmpd/pf_key_v2.c +++ b/sbin/isakmpd/pf_key_v2.c @@ -1,4 +1,4 @@ -/* $OpenBSD: pf_key_v2.c,v 1.199 2017/08/06 13:54:04 mpi Exp $ */ +/* $OpenBSD: pf_key_v2.c,v 1.200 2017/12/05 20:31:45 jca Exp $ */ /* $EOM: pf_key_v2.c,v 1.79 2000/12/12 00:33:19 niklas Exp $ */ /* @@ -35,7 +35,6 @@ #include <sys/ioctl.h> #include <sys/queue.h> #include <sys/socket.h> -#include <sys/time.h> #include <sys/uio.h> #include <net/pfkeyv2.h> @@ -204,7 +203,7 @@ pf_key_v2_read(u_int32_t seq) struct sadb_msg *msg; struct sadb_msg hdr; struct sadb_ext *ext; - struct timeval tv; + struct timespec ts; struct pollfd pfd[1]; pfd[0].fd = pf_key_v2_socket; @@ -298,9 +297,9 @@ pf_key_v2_read(u_int32_t seq) */ if (seq && (msg->sadb_msg_pid != (u_int32_t) getpid() || msg->sadb_msg_seq != seq)) { - gettimeofday(&tv, 0); + clock_gettime(CLOCK_MONOTONIC, &ts); timer_add_event("pf_key_v2_notify", - (void (*) (void *)) pf_key_v2_notify, ret, &tv); + (void (*) (void *)) pf_key_v2_notify, ret, &ts); ret = 0; continue; } |