diff options
author | 2015-08-28 12:15:54 +0000 | |
---|---|---|
committer | 2015-08-28 12:15:54 +0000 | |
commit | d04a4482a1e2b8bf25dc2ea225cf0340ba008fe0 (patch) | |
tree | b0e8c6e585e8190ccd1c4d0de640fd923bf724cb | |
parent | Move format job cleanup onto its own timer. (diff) | |
download | wireguard-openbsd-d04a4482a1e2b8bf25dc2ea225cf0340ba008fe0.tar.xz wireguard-openbsd-d04a4482a1e2b8bf25dc2ea225cf0340ba008fe0.zip |
Log time with message.
-rw-r--r-- | usr.bin/tmux/log.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/usr.bin/tmux/log.c b/usr.bin/tmux/log.c index e9708712184..14689f3e343 100644 --- a/usr.bin/tmux/log.c +++ b/usr.bin/tmux/log.c @@ -1,4 +1,4 @@ -/* $OpenBSD: log.c,v 1.12 2014/11/26 18:34:51 millert Exp $ */ +/* $OpenBSD: log.c,v 1.13 2015/08/28 12:15:54 nicm Exp $ */ /* * Copyright (c) 2007 Nicholas Marriott <nicm@users.sourceforge.net> @@ -67,11 +67,13 @@ void log_vwrite(const char *msg, va_list ap) { char *fmt; + time_t t; if (log_file == NULL) return; - if (asprintf(&fmt, "%s\n", msg) == -1) + t = time(NULL); + if (asprintf(&fmt, "%lld %s\n", (long long)t, msg) == -1) exit(1); if (vfprintf(log_file, fmt, ap) == -1) exit(1); |