projects
/
platform
/
upstream
/
cmocka.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
2535a15
)
src: Simplify exception_handler()
author
Andreas Schneider
<asn@cryptomilk.org>
Mon, 14 Sep 2015 16:24:41 +0000
(18:24 +0200)
committer
Andreas Schneider
<asn@cryptomilk.org>
Mon, 14 Sep 2015 16:24:41 +0000
(18:24 +0200)
src/cmocka.c
patch
|
blob
|
history
diff --git
a/src/cmocka.c
b/src/cmocka.c
index
fda3682
..
333a739
100644
(file)
--- a/
src/cmocka.c
+++ b/
src/cmocka.c
@@
-1797,11
+1797,14
@@
void _fail(const char * const file, const int line) {
#ifndef _WIN32
static void exception_handler(int sig) {
+ const char *sig_strerror = "";
+
#ifdef HAVE_STRSIGNAL
- cm_print_error("Test failed with exception: %s\n", strsignal(sig));
-#else
- cm_print_error("Test failed with exception: %d\n", sig);
+ sig_strerror = strsignal(sig);
#endif
+
+ cm_print_error("Test failed with exception: %s(%d)",
+ sig_strerror, sig);
exit_test(1);
}