diff options
author | Nicholas Marriott <nicm@cvs.openbsd.org> | 2015-08-28 12:15:55 +0000 |
---|---|---|
committer | Nicholas Marriott <nicm@cvs.openbsd.org> | 2015-08-28 12:15:55 +0000 |
commit | a0f66042c48615e4ba168910e70b22e732409314 (patch) | |
tree | 61c8c714076658a4d4031b44beeca5905c843766 | |
parent | 050aae96144db5ac2b1adf95a00de14f5b65a707 (diff) |
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); |