diff options
| author | Eric van Gyzen <vangyzen@FreeBSD.org> | 2020-01-13 22:01:37 +0000 |
|---|---|---|
| committer | Eric van Gyzen <vangyzen@FreeBSD.org> | 2020-01-13 22:01:37 +0000 |
| commit | a532f299c9c5b18497817df610c41de65bc0a096 (patch) | |
| tree | e0c2a007fc8615e4b3fdd76503f4435bc1fa4de7 /sbin | |
| parent | cf64777f503839bad15d92fd297f6585449fcc6d (diff) | |
Notes
Diffstat (limited to 'sbin')
| -rw-r--r-- | sbin/savecore/savecore.c | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/sbin/savecore/savecore.c b/sbin/savecore/savecore.c index fc6a50a0eb15..1f0ea8aa4f68 100644 --- a/sbin/savecore/savecore.c +++ b/sbin/savecore/savecore.c @@ -157,6 +157,8 @@ printheader(xo_handle_t *xo, const struct kerneldumpheader *h, { uint64_t dumplen; time_t t; + struct tm tm; + char time_str[64]; const char *stat_str; const char *comp_str; @@ -189,7 +191,10 @@ printheader(xo_handle_t *xo, const struct kerneldumpheader *h, } xo_emit_h(xo, "{P: }{Lwc:Compression}{:compression/%s}\n", comp_str); t = dtoh64(h->dumptime); - xo_emit_h(xo, "{P: }{Lwc:Dumptime}{:dumptime/%s}", ctime(&t)); + localtime_r(&t, &tm); + if (strftime(time_str, sizeof(time_str), "%F %T %z", &tm) == 0) + time_str[0] = '\0'; + xo_emit_h(xo, "{P: }{Lwc:Dumptime}{:dumptime/%s}\n", time_str); xo_emit_h(xo, "{P: }{Lwc:Hostname}{:hostname/%s}\n", h->hostname); xo_emit_h(xo, "{P: }{Lwc:Magic}{:magic/%s}\n", h->magic); xo_emit_h(xo, "{P: }{Lwc:Version String}{:version_string/%s}", |
