aboutsummaryrefslogtreecommitdiffstats
path: root/erts
diff options
context:
space:
mode:
authorBjörn-Egil Dahlberg <[email protected]>2017-03-15 11:43:55 +0100
committerBjörn-Egil Dahlberg <[email protected]>2017-03-15 11:43:55 +0100
commit9d8624408a81f49f243355df3f1ac133167089b0 (patch)
tree9bcd306edbaeee73531cd922cdc53b7ebb5b2638 /erts
parent27df945c35aa541330700d75b6844de9886361b2 (diff)
parentaec471e80bf086ae556c9c9b442c3d6cc864c6c8 (diff)
downloadotp-9d8624408a81f49f243355df3f1ac133167089b0.tar.gz
otp-9d8624408a81f49f243355df3f1ac133167089b0.tar.bz2
otp-9d8624408a81f49f243355df3f1ac133167089b0.zip
Merge branch 'egil/sigterm-fixup'
* egil/sigterm-fixup: erts: Fix signal pipe erts: Fix os_signal_SUITE test
Diffstat (limited to 'erts')
-rw-r--r--erts/emulator/sys/unix/sys.c4
-rw-r--r--erts/emulator/test/os_signal_SUITE.erl5
2 files changed, 6 insertions, 3 deletions
diff --git a/erts/emulator/sys/unix/sys.c b/erts/emulator/sys/unix/sys.c
index 0d1ed17449..e836f9bcc8 100644
--- a/erts/emulator/sys/unix/sys.c
+++ b/erts/emulator/sys/unix/sys.c
@@ -1274,8 +1274,8 @@ signal_dispatcher_thread_func(void *unused)
do {
res = read(sig_notify_fds[0], (void *) &sb.buf[i], sizeof(int) - i);
- i += res;
- } while ((i != sizeof(int) && res >= 0) || (res < 0 && errno == EINTR));
+ i += res > 0 ? res : 0;
+ } while ((i < sizeof(int) && res >= 0) || (res < 0 && errno == EINTR));
if (res < 0) {
erts_exit(ERTS_ABORT_EXIT,
diff --git a/erts/emulator/test/os_signal_SUITE.erl b/erts/emulator/test/os_signal_SUITE.erl
index 9aa49a453e..6bafb0e18c 100644
--- a/erts/emulator/test/os_signal_SUITE.erl
+++ b/erts/emulator/test/os_signal_SUITE.erl
@@ -323,7 +323,10 @@ kill(Signal, Pid) ->
load_nif(Config) ->
Path = proplists:get_value(data_dir, Config),
- ok = erlang:load_nif(filename:join(Path,"os_signal_nif"), 0).
+ case erlang:load_nif(filename:join(Path,"os_signal_nif"), 0) of
+ ok -> ok;
+ {error,{reload,_}} -> ok
+ end.
run(Program0, Args) -> run(".", Program0, Args).
run(Cwd, Program0, Args) when is_list(Cwd) ->