aboutsummaryrefslogtreecommitdiffstats
path: root/erts/epmd/src
diff options
context:
space:
mode:
authorStephan Renatus <[email protected]>2017-04-03 11:15:39 +0200
committerStephan Renatus <[email protected]>2017-04-03 11:15:39 +0200
commit161630f3e1e870dee50cd5c5161e9f09ebe9066b (patch)
treee9c82967b4d2ac85e3ceb250ea0469f58cc52541 /erts/epmd/src
parent6604585547b8e84d53aac174182cfb06289bbf73 (diff)
downloadotp-161630f3e1e870dee50cd5c5161e9f09ebe9066b.tar.gz
otp-161630f3e1e870dee50cd5c5161e9f09ebe9066b.tar.bz2
otp-161630f3e1e870dee50cd5c5161e9f09ebe9066b.zip
Don't exit 0 if killing epmd is impossible because there's living nodes
Living nodes will make `epmd -kill` fail, but there's no way to tell except by looking at the commands output. With this change, the exit code will be 1 to indicate failure. Signed-off-by: Stephan Renatus <[email protected]>
Diffstat (limited to 'erts/epmd/src')
-rw-r--r--erts/epmd/src/epmd_cli.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/erts/epmd/src/epmd_cli.c b/erts/epmd/src/epmd_cli.c
index 6fd27d46ea..b10b331cb5 100644
--- a/erts/epmd/src/epmd_cli.c
+++ b/erts/epmd/src/epmd_cli.c
@@ -46,10 +46,11 @@ void kill_epmd(EpmdVars *g)
if ((rval = read_fill(fd,buf,2)) == 2) {
if (buf[0] == 'O' && buf[1] == 'K') {
printf("Killed\n");
+ epmd_cleanup_exit(g,0);
} else {
printf("Killing not allowed - living nodes in database.\n");
+ epmd_cleanup_exit(g,1);
}
- epmd_cleanup_exit(g,0);
} else if (rval < 0) {
printf("epmd: failed to read answer from local epmd\n");
epmd_cleanup_exit(g,1);