aboutsummaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorSverker Eriksson <[email protected]>2016-03-01 14:30:34 +0100
committerSverker Eriksson <[email protected]>2016-03-01 14:30:34 +0100
commite1489c448b7486cdcfec6a89fea238d88e6ce2f3 (patch)
treee51068d8358245f5bc1726aec7130b9ff801b093 /lib
parent75bc5bebc070a59535b8f6b7b9085c210b4723b5 (diff)
parent1b094d72ffc56069c72f17c7edd673dbbfe47e39 (diff)
downloadotp-e1489c448b7486cdcfec6a89fea238d88e6ce2f3.tar.gz
otp-e1489c448b7486cdcfec6a89fea238d88e6ce2f3.tar.bz2
otp-e1489c448b7486cdcfec6a89fea238d88e6ce2f3.zip
Merge branch 'sverk/halt-INT_MIN' into maint
OTP-13251 * sverk/halt-INT_MIN: erts: Make erlang:halt() accept bignums as Status erts: Change erl_exit into erts_exit kernel: Remove calls to erl_exit
Diffstat (limited to 'lib')
-rw-r--r--lib/kernel/examples/uds_dist/c_src/uds_drv.c12
-rw-r--r--lib/runtime_tools/c_src/trace_file_drv.c4
-rw-r--r--lib/runtime_tools/c_src/trace_ip_drv.c15
3 files changed, 6 insertions, 25 deletions
diff --git a/lib/kernel/examples/uds_dist/c_src/uds_drv.c b/lib/kernel/examples/uds_dist/c_src/uds_drv.c
index e32ad69adf..8c028ba910 100644
--- a/lib/kernel/examples/uds_dist/c_src/uds_drv.c
+++ b/lib/kernel/examples/uds_dist/c_src/uds_drv.c
@@ -957,28 +957,24 @@ static void put_packet_length(char *b, int len)
/*
** Malloc wrappers
-** Note!
-** The function erl_exit is actually not a pert of the
-** driver interface, but it is very nice to use if one wants to halt
-** with a core and an erlang crash dump.
*/
static void *my_malloc(size_t size)
{
- void erl_exit(int, char *, ...);
void *ptr;
if ((ptr = driver_alloc(size)) == NULL) {
- erl_exit(1,"Could not allocate %lu bytes of memory",(unsigned long) size);
+ fprintf(stderr, "Could not allocate %lu bytes of memory",(unsigned long) size);
+ abort();
}
return ptr;
}
static void *my_realloc(void *ptr, size_t size)
{
- void erl_exit(int, char *, ...);
void *nptr;
if ((nptr = driver_realloc(ptr, size)) == NULL) {
- erl_exit(1,"Could not reallocate %lu bytes of memory",(unsigned long) size);
+ fprintf(stderr, "Could not reallocate %lu bytes of memory",(unsigned long) size);
+ abort();
}
return nptr;
}
diff --git a/lib/runtime_tools/c_src/trace_file_drv.c b/lib/runtime_tools/c_src/trace_file_drv.c
index a63a7d3ad9..8863b0d6ac 100644
--- a/lib/runtime_tools/c_src/trace_file_drv.c
+++ b/lib/runtime_tools/c_src/trace_file_drv.c
@@ -75,12 +75,8 @@
#ifdef DEBUG
-#ifndef __WIN32__
-#define ASSERT(X) do {if (!(X)) {erl_exit(1,"%s",#X);} } while(0)
-#else
#include <assert.h>
#define ASSERT(X) assert(X)
-#endif
#else
#define ASSERT(X)
#endif
diff --git a/lib/runtime_tools/c_src/trace_ip_drv.c b/lib/runtime_tools/c_src/trace_ip_drv.c
index f7b5ea65cb..5b43f8179e 100644
--- a/lib/runtime_tools/c_src/trace_ip_drv.c
+++ b/lib/runtime_tools/c_src/trace_ip_drv.c
@@ -44,19 +44,8 @@
#endif
#ifdef DEBUG
-# ifndef __WIN32__
- /* erl_exit is not available to dll_drivers on windows. */
- void erl_exit(int, char *, ...);
-# define ASSERT(X) \
- do { \
- if (!(X)) { \
- erl_exit(1,"%s",#X); \
- } \
- } while(0)
-# else
-# include <assert.h>
-# define ASSERT(X) assert(X)
-# endif
+# include <assert.h>
+# define ASSERT(X) assert(X)
#else
# define ASSERT(X)
#endif