diff options
author | Lukas Larsson <[email protected]> | 2016-06-07 09:45:01 +0200 |
---|---|---|
committer | Lukas Larsson <[email protected]> | 2016-06-07 09:45:01 +0200 |
commit | ac18b8705c78be8bec5bdc14c412af2ced740916 (patch) | |
tree | f6a0a03215e409bb82f3087d9363c06d593de16f /erts/etc/common | |
parent | d26c15e07229c90ba8353bd78d5406ada0f13271 (diff) | |
parent | 85996c92853e90cb233a1405b1c8c7bb1b8ca54e (diff) | |
download | otp-ac18b8705c78be8bec5bdc14c412af2ced740916.tar.gz otp-ac18b8705c78be8bec5bdc14c412af2ced740916.tar.bz2 otp-ac18b8705c78be8bec5bdc14c412af2ced740916.zip |
Merge branch 'dotsimon/erts/heart_no_kill/OTP-13650'
* dotsimon/erts/heart_no_kill/OTP-13650:
erts: make HEART_NO_KILL have to be set to TRUE
Don't kill old erlang if HEART_NO_KILL is set
Conflicts:
lib/kernel/doc/src/heart.xml
Diffstat (limited to 'erts/etc/common')
-rw-r--r-- | erts/etc/common/heart.c | 18 |
1 files changed, 15 insertions, 3 deletions
diff --git a/erts/etc/common/heart.c b/erts/etc/common/heart.c index e931ae4641..a4008186c4 100644 --- a/erts/etc/common/heart.c +++ b/erts/etc/common/heart.c @@ -119,6 +119,8 @@ #define HEART_COMMAND_ENV "HEART_COMMAND" #define ERL_CRASH_DUMP_SECONDS_ENV "ERL_CRASH_DUMP_SECONDS" #define HEART_KILL_SIGNAL "HEART_KILL_SIGNAL" +#define HEART_NO_KILL "HEART_NO_KILL" + #define MSG_HDR_SIZE (2) #define MSG_HDR_PLUS_OP_SIZE (3) @@ -524,6 +526,12 @@ static void kill_old_erlang(void){ HANDLE erlh; DWORD exit_code; + char* envvar = NULL; + + envvar = get_env(HEART_NO_KILL); + if (!envvar || strcmp(envvar, "TRUE") == 0) + return; + if(heart_beat_kill_pid != 0){ if((erlh = OpenProcess(PROCESS_TERMINATE | SYNCHRONIZE | @@ -555,10 +563,14 @@ kill_old_erlang(void){ pid_t pid; int i, res; int sig = SIGKILL; - char *sigenv = NULL; + char *envvar = NULL; + + envvar = get_env(HEART_NO_KILL); + if (!envvar || strcmp(envvar, "TRUE") == 0) + return; - sigenv = get_env(HEART_KILL_SIGNAL); - if (sigenv && strcmp(sigenv, "SIGABRT") == 0) { + envvar = get_env(HEART_KILL_SIGNAL); + if (envvar && strcmp(envvar, "SIGABRT") == 0) { print_error("kill signal SIGABRT requested"); sig = SIGABRT; } |