aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLukas Larsson <[email protected]>2016-06-10 08:34:36 +0200
committerLukas Larsson <[email protected]>2016-06-10 09:55:33 +0200
commit98068b0698d6cc0d0dd172ab575b1b4c74d864fb (patch)
treeee92967c8b91f4f8027b13a729486f5d68e5ff2d
parent85996c92853e90cb233a1405b1c8c7bb1b8ca54e (diff)
downloadotp-98068b0698d6cc0d0dd172ab575b1b4c74d864fb.tar.gz
otp-98068b0698d6cc0d0dd172ab575b1b4c74d864fb.tar.bz2
otp-98068b0698d6cc0d0dd172ab575b1b4c74d864fb.zip
erts: Fix HEART_NO_KILL logic
-rw-r--r--erts/etc/common/heart.c4
-rw-r--r--lib/kernel/test/heart_SUITE.erl7
2 files changed, 7 insertions, 4 deletions
diff --git a/erts/etc/common/heart.c b/erts/etc/common/heart.c
index 0dd82cc036..6f14b08deb 100644
--- a/erts/etc/common/heart.c
+++ b/erts/etc/common/heart.c
@@ -529,7 +529,7 @@ kill_old_erlang(void){
char* envvar = NULL;
envvar = get_env(HEART_NO_KILL);
- if (!envvar || strcmp(envvar, "TRUE") == 0)
+ if (envvar && strcmp(envvar, "TRUE") == 0)
return;
if(heart_beat_kill_pid != 0){
@@ -566,7 +566,7 @@ kill_old_erlang(void){
char *envvar = NULL;
envvar = get_env(HEART_NO_KILL);
- if (!envvar || strcmp(envvar, "TRUE") == 0)
+ if (envvar && strcmp(envvar, "TRUE") == 0)
return;
envvar = get_env(HEART_KILL_SIGNAL);
diff --git a/lib/kernel/test/heart_SUITE.erl b/lib/kernel/test/heart_SUITE.erl
index 16b9f7a9ee..c18d12c2b2 100644
--- a/lib/kernel/test/heart_SUITE.erl
+++ b/lib/kernel/test/heart_SUITE.erl
@@ -70,7 +70,8 @@ all() -> [
set_cmd, clear_cmd, get_cmd,
callback_api,
options_api,
- kill_pid
+ kill_pid,
+ heart_no_kill
].
groups() ->
@@ -650,7 +651,9 @@ suicide_by_heart() ->
end.
non_suicide_by_heart() ->
- P = open_port({spawn,"heart -ht 11 -pid "++os:getpid()},[exit_status, {env, {"HEART_NO_KILL", "TRUE"}}, {packet,2}]),
+ P = open_port({spawn,"heart -ht 11 -pid "++os:getpid()},
+ [exit_status, {env, [{"HEART_NO_KILL", "TRUE"}]},
+ {packet,2}]),
receive X -> X end,
%% Just hang and wait for heart to timeout
receive