hrev52788 adds 2 changesets to branch 'master'
old head: f22ee592d6f48d2fc58e2c4a1236694b770f6064
new head: 7282d46cef469c371d8a0e4645e2a0065f19b932
overview:
https://git.haiku-os.org/haiku/log/?qt=range&q=7282d46cef46+%5Ef22ee592d6f4
----------------------------------------------------------------------------
f52bb5ce10c3: 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.
7282d46cef46: libroot: Style cleanups in assert.c.
[ Augustin Cavalier <waddlesplash@xxxxxxxxx> ]
----------------------------------------------------------------------------
1 file changed, 15 insertions(+), 13 deletions(-)
src/system/libroot/posix/assert.c | 28 +++++++++++++++-------------
############################################################################
Commit: f52bb5ce10c3d99dbab9d370541b70d4cfb5efe4
URL: https://git.haiku-os.org/haiku/commit/?id=f52bb5ce10c3
Author: Augustin Cavalier <waddlesplash@xxxxxxxxx>
Date: Wed Jan 23 02:50:17 2019 UTC
Ticket: https://dev.haiku-os.org/ticket/10295
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.
----------------------------------------------------------------------------
diff --git a/src/system/libroot/posix/assert.c
b/src/system/libroot/posix/assert.c
index abefb7333d..82fc6a474e 100644
--- a/src/system/libroot/posix/assert.c
+++ b/src/system/libroot/posix/assert.c
@@ -1,7 +1,7 @@
-/*
-** Copyright 2004, Axel Dörfler, axeld@xxxxxxxxxxxxxxxx. All rights reserved.
-** Distributed under the terms of the Haiku License.
-*/
+/*
+ * Copyright 2004, Axel Dörfler, axeld@xxxxxxxxxxxxxxxx. 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();
}
############################################################################
Revision: hrev52788
Commit: 7282d46cef469c371d8a0e4645e2a0065f19b932
URL: https://git.haiku-os.org/haiku/commit/?id=7282d46cef46
Author: Augustin Cavalier <waddlesplash@xxxxxxxxx>
Date: Wed Jan 23 02:53:08 2019 UTC
libroot: Style cleanups in assert.c.
----------------------------------------------------------------------------
diff --git a/src/system/libroot/posix/assert.c
b/src/system/libroot/posix/assert.c
index 82fc6a474e..c840b54bdd 100644
--- a/src/system/libroot/posix/assert.c
+++ b/src/system/libroot/posix/assert.c
@@ -14,22 +14,24 @@
#include <string.h>
-extern char *__progname;
+extern char* __progname;
void
-__assert_fail(const char *assertion, const char *file,
- unsigned int line, const char *function)
+__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);
+ fprintf(stderr, "%s: %s:%d:%s: %s\n", __progname, file, line, function,
+ assertion);
abort();
}
void
-__assert_perror_fail(int error, const char *file,
- unsigned int line, const char *function)
+__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));
+ fprintf(stderr, "%s: %s:%d:%s: %s\n", __progname, file, line, function,
+ strerror(error));
abort();
}