diff options
Diffstat (limited to 'usr.bin/dig/lib/isc/unix')
| -rw-r--r-- | usr.bin/dig/lib/isc/unix/include/isc/time.h | 16 | ||||
| -rw-r--r-- | usr.bin/dig/lib/isc/unix/time.c | 29 |
2 files changed, 4 insertions, 41 deletions
diff --git a/usr.bin/dig/lib/isc/unix/include/isc/time.h b/usr.bin/dig/lib/isc/unix/include/isc/time.h index dda34713ae4..ef3bb36b6bf 100644 --- a/usr.bin/dig/lib/isc/unix/include/isc/time.h +++ b/usr.bin/dig/lib/isc/unix/include/isc/time.h @@ -14,7 +14,7 @@ * PERFORMANCE OF THIS SOFTWARE. */ -/* $Id: time.h,v 1.11 2020/02/16 21:08:59 florian Exp $ */ +/* $Id: time.h,v 1.12 2020/02/16 21:09:32 florian Exp $ */ #ifndef ISC_TIME_H #define ISC_TIME_H 1 @@ -67,20 +67,6 @@ isc_time_microdiff(const struct timespec *t1, const struct timespec *t2); */ void -isc_time_formattimestamp(const struct timespec *t, char *buf, unsigned int len); -/*%< - * Format the time 't' into the buffer 'buf' of length 'len', - * using a format like "30-Aug-2000 04:06:47.997" and the local time zone. - * If the text does not fit in the buffer, the result is indeterminate, - * but is always guaranteed to be null terminated. - * - * Requires: - *\li 'len' > 0 - *\li 'buf' points to an array of at least len chars - * - */ - -void isc_time_formathttptimestamp(const struct timespec *t, char *buf, unsigned int len); /*%< * Format the time 't' into the buffer 'buf' of length 'len', diff --git a/usr.bin/dig/lib/isc/unix/time.c b/usr.bin/dig/lib/isc/unix/time.c index a0f60d032fd..bdc2ea89c0a 100644 --- a/usr.bin/dig/lib/isc/unix/time.c +++ b/usr.bin/dig/lib/isc/unix/time.c @@ -14,23 +14,19 @@ * PERFORMANCE OF THIS SOFTWARE. */ -/* $Id: time.c,v 1.14 2020/02/16 21:08:59 florian Exp $ */ +/* $Id: time.c,v 1.15 2020/02/16 21:09:32 florian Exp $ */ /*! \file */ - +#include <sys/time.h> #include <errno.h> #include <limits.h> #include <stdio.h> #include <time.h> - -#include <sys/time.h> /* Required for struct timeval on some platforms. */ - - #include <string.h> -#include <isc/time.h> +#include <isc/time.h> #include <isc/util.h> #define NS_PER_S 1000000000 /*%< Nanoseconds per second. */ @@ -72,25 +68,6 @@ isc_time_microdiff(const struct timespec *t1, const struct timespec *t2) { } void -isc_time_formattimestamp(const struct timespec *t, char *buf, unsigned int len) { - unsigned int flen; - - REQUIRE(t != NULL); - INSIST(t->tv_nsec < NS_PER_S); - REQUIRE(buf != NULL); - REQUIRE(len > 0); - - flen = strftime(buf, len, "%d-%b-%Y %X", localtime(&t->tv_sec)); - INSIST(flen < len); - if (flen != 0) { - snprintf(buf + flen, len - flen, - ".%03ld", t->tv_nsec / 1000000); - } else { - strlcpy(buf, "99-Bad-9999 99:99:99.999", len); - } -} - -void isc_time_formathttptimestamp(const struct timespec *t, char *buf, unsigned int len) { unsigned int flen; |
