chiark / gitweb /
log: reopen log for failed assertions (#6703)
authorTopi Miettinen <topimiettinen@users.noreply.github.com>
Thu, 31 Aug 2017 08:37:32 +0000 (08:37 +0000)
committerSven Eden <yamakuzure@gmx.net>
Thu, 31 Aug 2017 08:37:32 +0000 (08:37 +0000)
Reopen log so that failed and aborting assertions can be written to log.

Closes: #6658
src/basic/log.c

index 82db00ed29d09b3ee6e1bea3f53ab65d64fb9728..229f246ff0a63b943277f3671066c14f5d0bab21 100644 (file)
@@ -820,6 +820,7 @@ noreturn void log_assert_failed_realm(
                 const char *file,
                 int line,
                 const char *func) {
+        log_open();
         log_assert(LOG_REALM_PLUS_LEVEL(realm, LOG_CRIT), text, file, line, func,
                    "Assertion '%s' failed at %s:%u, function %s(). Aborting.");
         abort();
@@ -831,6 +832,7 @@ noreturn void log_assert_failed_unreachable_realm(
                 const char *file,
                 int line,
                 const char *func) {
+        log_open();
         log_assert(LOG_REALM_PLUS_LEVEL(realm, LOG_CRIT), text, file, line, func,
                    "Code should not be reached '%s' at %s:%u, function %s(). Aborting.");
         abort();