summaryrefslogtreecommitdiffstats
path: root/usr.bin/dig/host.c
diff options
context:
space:
mode:
authorflorian <florian@openbsd.org>2020-02-16 21:11:02 +0000
committerflorian <florian@openbsd.org>2020-02-16 21:11:02 +0000
commita12dcefb48e200107d0d2d0ced8c8d9c25cb6d86 (patch)
tree9fb057b930c99b994191b88919f80cc550e5796c /usr.bin/dig/host.c
parentMove isc_time_formathttptimestamp to the only place it is used. (diff)
downloadwireguard-openbsd-a12dcefb48e200107d0d2d0ced8c8d9c25cb6d86.tar.xz
wireguard-openbsd-a12dcefb48e200107d0d2d0ced8c8d9c25cb6d86.zip
clock_gettime cannot fail if called correctly; unravel TIME_NOW
indirections. (I'm not convinced that we always want to read CLOCK_REALTIME, in fact we probably want to almost always read CLOCK_MONOTONIC.) OK millert
Diffstat (limited to 'usr.bin/dig/host.c')
-rw-r--r--usr.bin/dig/host.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/usr.bin/dig/host.c b/usr.bin/dig/host.c
index dc66fbea3b3..fb3b6532d6f 100644
--- a/usr.bin/dig/host.c
+++ b/usr.bin/dig/host.c
@@ -149,7 +149,7 @@ received(unsigned int bytes, isc_sockaddr_t *from, dig_query_t *query) {
if (!short_form) {
char fromtext[ISC_SOCKADDR_FORMATSIZE];
isc_sockaddr_format(from, fromtext, sizeof(fromtext));
- TIME_NOW(&now);
+ clock_gettime(CLOCK_REALTIME, &now);
diff = (int) isc_time_microdiff(&now, &query->time_sent);
printf("Received %u bytes from %s in %d ms\n",
bytes, fromtext, diff/1000);