diff options
author | 2013-09-09 05:10:32 +0000 | |
---|---|---|
committer | 2013-09-09 05:10:32 +0000 | |
commit | 911117f30d9d97d64dbc258e9a660cbf23c8dade (patch) | |
tree | cb8bf7dbca741ebd81cf4a93236f428bc8cf2d13 | |
parent | Rename the 'pid' global to eliminate compiler warnings about shadowing (diff) | |
download | wireguard-openbsd-911117f30d9d97d64dbc258e9a660cbf23c8dade.tar.xz wireguard-openbsd-911117f30d9d97d64dbc258e9a660cbf23c8dade.zip |
Recognize the UTIME_OMIT and UTIME_NOW values when printing timespecs
ok otto@
-rw-r--r-- | usr.bin/kdump/ktrstruct.c | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/usr.bin/kdump/ktrstruct.c b/usr.bin/kdump/ktrstruct.c index e7ed3b4bf7e..36fc2642053 100644 --- a/usr.bin/kdump/ktrstruct.c +++ b/usr.bin/kdump/ktrstruct.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ktrstruct.c,v 1.1 2013/08/22 02:02:33 guenther Exp $ */ +/* $OpenBSD: ktrstruct.c,v 1.2 2013/09/09 05:10:32 guenther Exp $ */ /*- * Copyright (c) 1988, 1993 @@ -151,9 +151,15 @@ print_time(time_t t, int relative) static void print_timespec(const struct timespec *tsp, int relative) { - print_time(tsp->tv_sec, relative); - if (tsp->tv_nsec != 0) - printf(".%09ld", tsp->tv_nsec); + if (tsp->tv_nsec == UTIME_NOW) + printf("UTIME_NOW"); + else if (tsp->tv_nsec == UTIME_OMIT) + printf("UTIME_OMIT"); + else { + print_time(tsp->tv_sec, relative); + if (tsp->tv_nsec != 0) + printf(".%09ld", tsp->tv_nsec); + } } static void |