log: reopen log for failed assertions (#6703)

Reopen log so that failed and aborting assertions can be written to log.

Closes: #6658
This commit is contained in:
Topi Miettinen 2017-08-31 08:37:32 +00:00 committed by Lennart Poettering
parent e9ea4526a3
commit ea89a119cd
1 changed files with 2 additions and 0 deletions

View 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();