summaryrefslogtreecommitdiffstats
path: root/log.c
diff options
context:
space:
mode:
authorThomas Adam <thomas@xteddy.org>2021-03-31 10:01:16 +0100
committerThomas Adam <thomas@xteddy.org>2021-03-31 10:01:16 +0100
commit8f5ff4bf6676f1220bd9365b1d5b8ec8f58c93d7 (patch)
tree71edeabe68ba8ce245d985cd06b2712115d9258f /log.c
parent4208641de7045299a10f51209bec4623cbea6744 (diff)
parenta4b9b5a1e5326b4ac4dfb439627b735d831b8992 (diff)
Merge branch 'obsd-master' into master
Diffstat (limited to 'log.c')
-rw-r--r--log.c13
1 files changed, 7 insertions, 6 deletions
diff --git a/log.c b/log.c
index f87cab92..26569974 100644
--- a/log.c
+++ b/log.c
@@ -110,15 +110,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);