aboutsummaryrefslogtreecommitdiffstats
path: root/erts/emulator/sys
diff options
context:
space:
mode:
authorSverker Eriksson <[email protected]>2015-11-30 12:00:44 +0100
committerLukas Larsson <[email protected]>2015-12-15 10:05:48 +0100
commit10ffa0b2f8c66b3a318503b4dfdfe02d6577d746 (patch)
tree5df3faaf12ae774feabeb0169109b576d394f21b /erts/emulator/sys
parent70c4711252e260e4ad4c43625226b21ecf775a75 (diff)
downloadotp-10ffa0b2f8c66b3a318503b4dfdfe02d6577d746.tar.gz
otp-10ffa0b2f8c66b3a318503b4dfdfe02d6577d746.tar.bz2
otp-10ffa0b2f8c66b3a318503b4dfdfe02d6577d746.zip
erts: Mend ASSERT makro for erl_child_setup
when called by hash.c for example. We use ASSERT from sys.h but erl_child_setup implements its own erl_assert_error() as it doesn't link with sys.o.
Diffstat (limited to 'erts/emulator/sys')
-rw-r--r--erts/emulator/sys/unix/erl_child_setup.c13
1 files changed, 9 insertions, 4 deletions
diff --git a/erts/emulator/sys/unix/erl_child_setup.c b/erts/emulator/sys/unix/erl_child_setup.c
index 998a0d297f..94d1fd64c7 100644
--- a/erts/emulator/sys/unix/erl_child_setup.c
+++ b/erts/emulator/sys/unix/erl_child_setup.c
@@ -83,11 +83,16 @@
abort(); \
} while(0)
-#undef ASSERT
#ifdef DEBUG
-#define ASSERT(cnd) do { if (!(cnd)) { ABORT("assertion %s failed", #cnd); } } while(0)
-#else
-#define ASSERT(cnd)
+void
+erl_assert_error(const char* expr, const char* func, const char* file, int line)
+{
+ fflush(stdout);
+ fprintf(stderr, "%s:%d:%s() Assertion failed: %s\n",
+ file, line, func, expr);
+ fflush(stderr);
+ abort();
+}
#endif
void sys_sigblock(int sig)