summaryrefslogtreecommitdiff
path: root/usr.bin/dig/host.c
diff options
context:
space:
mode:
authorFlorian Obser <florian@cvs.openbsd.org>2020-02-21 07:44:51 +0000
committerFlorian Obser <florian@cvs.openbsd.org>2020-02-21 07:44:51 +0000
commite9526657fd44ce30ca23c3300b51ce25ee4bf72d (patch)
tree55a27976e2a5297dfc17207db6d9f661729f839c /usr.bin/dig/host.c
parent5681478617903bd49639c707b53123d7a1644c09 (diff)
Read CLOCK_MONOTONIC when we need timestamps to compare and use
time(3) for the wall clock. prodding & OK jung
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 123a0ccf632..71a95ce9265 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));
- clock_gettime(CLOCK_REALTIME, &now);
+ clock_gettime(CLOCK_MONOTONIC, &now);
diff = (int) isc_time_microdiff(&now, &query->time_sent);
printf("Received %u bytes from %s in %d ms\n",
bytes, fromtext, diff/1000);