diff options
author | Sverker Eriksson <[email protected]> | 2016-07-07 20:02:31 +0200 |
---|---|---|
committer | Sverker Eriksson <[email protected]> | 2016-07-07 20:02:31 +0200 |
commit | fcddab275754de3a07623c7b9bdbe8966ef1a24c (patch) | |
tree | e62eed5cbbf62f7867a64a88b28ea33a987e5d05 /erts/emulator | |
parent | 9026aeebb86396e850a8f6347d1a81f9e2db5918 (diff) | |
parent | 895c08431ff48b9451fa882d508e9f8201396186 (diff) | |
download | otp-fcddab275754de3a07623c7b9bdbe8966ef1a24c.tar.gz otp-fcddab275754de3a07623c7b9bdbe8966ef1a24c.tar.bz2 otp-fcddab275754de3a07623c7b9bdbe8966ef1a24c.zip |
Merge branch 'sverker/child-setup-debugging' into maint
Diffstat (limited to 'erts/emulator')
-rw-r--r-- | erts/emulator/sys/unix/erl_child_setup.c | 16 |
1 files changed, 12 insertions, 4 deletions
diff --git a/erts/emulator/sys/unix/erl_child_setup.c b/erts/emulator/sys/unix/erl_child_setup.c index 6beb316350..de61726e5b 100644 --- a/erts/emulator/sys/unix/erl_child_setup.c +++ b/erts/emulator/sys/unix/erl_child_setup.c @@ -54,6 +54,7 @@ #include <stdlib.h> #include <stdio.h> +#include <stdarg.h> #include <sys/wait.h> #define WANT_NONBLOCKING @@ -79,10 +80,17 @@ #define DEBUG_PRINT(fmt, ...) #endif -#define ABORT(fmt, ...) do { \ - fprintf(stderr, "erl_child_setup: " fmt "\r\n", ##__VA_ARGS__); \ - abort(); \ - } while(0) +static char abort_reason[200]; /* for core dump inspection */ + +static void ABORT(const char* fmt, ...) +{ + va_list arglist; + va_start(arglist, fmt); + vsprintf(abort_reason, fmt, arglist); + fprintf(stderr, "erl_child_setup: %s\r\n", abort_reason); + va_end(arglist); + abort(); +} #ifdef DEBUG void |