diff options
author | 2021-03-31 08:37:48 +0000 | |
---|---|---|
committer | 2021-03-31 08:37:48 +0000 | |
commit | b96171b138fe71092142a1c09bd31f491e86657a (patch) | |
tree | 33addbc79800a15b28e45e665505d23bb00a3278 | |
parent | document trusted_snapshot (diff) | |
download | wireguard-openbsd-b96171b138fe71092142a1c09bd31f491e86657a.tar.xz wireguard-openbsd-b96171b138fe71092142a1c09bd31f491e86657a.zip |
Do not exit if cannot write to normal log file, GitHub issue 2630.
-rw-r--r-- | usr.bin/tmux/log.c | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/usr.bin/tmux/log.c b/usr.bin/tmux/log.c index 0bbcb1f7ff5..e52297aa464 100644 --- a/usr.bin/tmux/log.c +++ b/usr.bin/tmux/log.c @@ -1,4 +1,4 @@ -/* $OpenBSD: log.c,v 1.26 2019/09/24 20:44:58 nicm Exp $ */ +/* $OpenBSD: log.c,v 1.27 2021/03/31 08:37:48 nicm Exp $ */ /* * Copyright (c) 2007 Nicholas Marriott <nicholas.marriott@gmail.com> @@ -111,15 +111,16 @@ log_vwrite(const char *msg, va_list ap) return; if (vasprintf(&fmt, msg, ap) == -1) - exit(1); - if (stravis(&out, fmt, VIS_OCTAL|VIS_CSTYLE|VIS_TAB|VIS_NL) == -1) - exit(1); + return; + if (stravis(&out, fmt, VIS_OCTAL|VIS_CSTYLE|VIS_TAB|VIS_NL) == -1) { + free(fmt); + return; + } gettimeofday(&tv, NULL); if (fprintf(log_file, "%lld.%06d %s\n", (long long)tv.tv_sec, - (int)tv.tv_usec, out) == -1) - exit(1); - fflush(log_file); + (int)tv.tv_usec, out) != -1) + fflush(log_file); free(out); free(fmt); |