diff options
| author | 2020-09-14 08:37:08 +0000 | |
|---|---|---|
| committer | 2020-09-14 08:37:08 +0000 | |
| commit | 427f8978f693be8a82c3e3442697737b82a839e9 (patch) | |
| tree | 149b09a9a31c376a92215366106e35cb07e468be /usr.bin/dig/lib/isc/unix/time.c | |
| parent | re-enable new x509 chain verifier as the default (diff) | |
| download | wireguard-openbsd-427f8978f693be8a82c3e3442697737b82a839e9.tar.xz wireguard-openbsd-427f8978f693be8a82c3e3442697737b82a839e9.zip | |
Rewrite isc_time_microdiff() as uelapsed() and put it directly
into dig sources, lets us get rid of unix/time.{c,h}
OK deraadt
Diffstat (limited to 'usr.bin/dig/lib/isc/unix/time.c')
| -rw-r--r-- | usr.bin/dig/lib/isc/unix/time.c | 41 |
1 files changed, 0 insertions, 41 deletions
diff --git a/usr.bin/dig/lib/isc/unix/time.c b/usr.bin/dig/lib/isc/unix/time.c deleted file mode 100644 index d073515bfbd..00000000000 --- a/usr.bin/dig/lib/isc/unix/time.c +++ /dev/null @@ -1,41 +0,0 @@ -/* - * Copyright (C) Internet Systems Consortium, Inc. ("ISC") - * - * Permission to use, copy, modify, and/or distribute this software for any - * purpose with or without fee is hereby granted, provided that the above - * copyright notice and this permission notice appear in all copies. - * - * THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH - * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY - * AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT, - * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM - * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE - * OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR - * PERFORMANCE OF THIS SOFTWARE. - */ - -/* $Id: time.c,v 1.18 2020/02/16 21:11:31 florian Exp $ */ - -/*! \file */ - -#include <sys/time.h> -#include <time.h> - -#include <isc/time.h> -#include <isc/util.h> - -#define NS_PER_S 1000000000 /*%< Nanoseconds per second. */ -#define NS_PER_US 1000 /*%< Nanoseconds per microsecond. */ - -uint64_t -isc_time_microdiff(const struct timespec *t1, const struct timespec *t2) { - struct timespec res; - - REQUIRE(t1 != NULL && t2 != NULL); - - timespecsub(t1, t2, &res); - if (res.tv_sec < 0) - return 0; - - return ((res.tv_sec * NS_PER_S + res.tv_nsec) / NS_PER_US); -} |
