diff options
author | nicm <nicm> | 2021-03-31 08:37:48 +0000 |
---|---|---|
committer | nicm <nicm> | 2021-03-31 08:37:48 +0000 |
commit | a4b9b5a1e5326b4ac4dfb439627b735d831b8992 (patch) | |
tree | b4fa67dcb76c03313f184132d89b5f5f14529547 | |
parent | 8b800b41c98c37a270cea61e57d1f2702fd75293 (diff) | |
download | rtmux-a4b9b5a1e5326b4ac4dfb439627b735d831b8992.tar.gz rtmux-a4b9b5a1e5326b4ac4dfb439627b735d831b8992.tar.bz2 rtmux-a4b9b5a1e5326b4ac4dfb439627b735d831b8992.zip |
Do not exit if cannot write to normal log file, GitHub issue 2630.
-rw-r--r-- | log.c | 13 |
1 files changed, 7 insertions, 6 deletions
@@ -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); |