]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
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)
committerLennart Poettering <lennart@poettering.net>
Thu, 31 Aug 2017 08:37:32 +0000 (10:37 +0200)
Reopen log so that failed and aborting assertions can be written to log.

Closes: #6658
src/basic/log.c

index d0caeb5ca39182854e7447452d1c631e8c208112..421ae52dc5f69d09ce5f9d4636e69bdd885f56cd 100644 (file)
@@ -804,6 +804,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();
@@ -815,6 +816,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();