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:
@@ -1,7 +1,7 @@
|
||||
/*
|
||||
** Copyright 2004, Axel Dörfler, [email protected]. All rights reserved.
|
||||
** Distributed under the terms of the Haiku License.
|
||||
*/
|
||||
/*
|
||||
* Copyright 2004, Axel Dörfler, [email protected]. All rights reserved.
|
||||
* Distributed under the terms of the MIT License.
|
||||
*/
|
||||
|
||||
|
||||
#undef NDEBUG
|
||||
@@ -22,7 +22,7 @@ __assert_fail(const char *assertion, const char *file,
|
||||
unsigned int line, const char *function)
|
||||
{
|
||||
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)
|
||||
{
|
||||
fprintf(stderr, "%s: %s:%d:%s: %s\n", __progname, file, line, function, strerror(error));
|
||||
debugger(strerror(error));
|
||||
abort();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user