libroot: Call abort() instead of debugger() from assert().

As per the POSIX specification.

This gives the calling program a chance to catch the assertion. But
in the case where no signal handler is installed for SIGABRT, we
will call debugger() anyway and present as a crash as before.

Fixes #10295.
This commit is contained in:
Augustin Cavalier
2019-01-22 21:50:17 -05:00
parent f22ee592d6
commit f52bb5ce10
+4 -4
View File
@@ -1,6 +1,6 @@
/* /*
** Copyright 2004, Axel Dörfler, [email protected]. All rights reserved. * Copyright 2004, Axel Dörfler, [email protected]. All rights reserved.
** Distributed under the terms of the Haiku License. * Distributed under the terms of the MIT License.
*/ */
@@ -22,7 +22,7 @@ __assert_fail(const char *assertion, const char *file,
unsigned int line, const char *function) unsigned int line, const char *function)
{ {
fprintf(stderr, "%s: %s:%d:%s: %s\n", __progname, file, line, function, assertion); fprintf(stderr, "%s: %s:%d:%s: %s\n", __progname, file, line, function, assertion);
debugger(assertion); abort();
} }
@@ -31,5 +31,5 @@ __assert_perror_fail(int error, const char *file,
unsigned int line, const char *function) unsigned int line, const char *function)
{ {
fprintf(stderr, "%s: %s:%d:%s: %s\n", __progname, file, line, function, strerror(error)); fprintf(stderr, "%s: %s:%d:%s: %s\n", __progname, file, line, function, strerror(error));
debugger(strerror(error)); abort();
} }