aboutsummaryrefslogtreecommitdiffstats
path: root/erts/emulator/test
diff options
context:
space:
mode:
authorBjörn-Egil Dahlberg <egil@erlang.org>2017-01-24 10:59:30 +0100
committerBjörn-Egil Dahlberg <egil@erlang.org>2017-02-02 09:40:28 +0100
commitd4bd17da9759af54227891a90d9fb83d5bfe6d7e (patch)
treea1b75a3b750b073d46e7a34bfe4a80eddc62a02e /erts/emulator/test
parent9ccb988eeb79815a33e0dd138278e0c29ed3ca6a (diff)
downloadotp-d4bd17da9759af54227891a90d9fb83d5bfe6d7e.tar.gz
otp-d4bd17da9759af54227891a90d9fb83d5bfe6d7e.tar.bz2
otp-d4bd17da9759af54227891a90d9fb83d5bfe6d7e.zip
erts: Use os module instead of erts_internal for set_signal/2
* Add specs * Change return signature to 'ok' instead of 'true'
Diffstat (limited to 'erts/emulator/test')
-rw-r--r--erts/emulator/test/os_signal_SUITE.erl48
1 files changed, 24 insertions, 24 deletions
diff --git a/erts/emulator/test/os_signal_SUITE.erl b/erts/emulator/test/os_signal_SUITE.erl
index 7c3950114f..9aa49a453e 100644
--- a/erts/emulator/test/os_signal_SUITE.erl
+++ b/erts/emulator/test/os_signal_SUITE.erl
@@ -92,9 +92,9 @@ set_unset(_Config) ->
sigusr1, sigusr2,
sigchld,
sigstop, sigtstp],
- F1 = fun(Sig) -> true = erts_internal:set_signal(Sig,handle) end,
- F2 = fun(Sig) -> true = erts_internal:set_signal(Sig,default) end,
- F3 = fun(Sig) -> true = erts_internal:set_signal(Sig,ignore) end,
+ F1 = fun(Sig) -> ok = os:set_signal(Sig,handle) end,
+ F2 = fun(Sig) -> ok = os:set_signal(Sig,default) end,
+ F3 = fun(Sig) -> ok = os:set_signal(Sig,ignore) end,
%% set handle
ok = lists:foreach(F1, Signals),
%% set ignore
@@ -106,7 +106,7 @@ set_unset(_Config) ->
t_sighup(_Config) ->
Pid1 = setup_service(),
OsPid = os:getpid(),
- erts_internal:set_signal(sighup, handle),
+ os:set_signal(sighup, handle),
ok = kill("HUP", OsPid),
ok = kill("HUP", OsPid),
ok = kill("HUP", OsPid),
@@ -121,7 +121,7 @@ t_sighup(_Config) ->
ok = kill("HUP", OsPid),
%% ignore
Pid2 = setup_service(),
- erts_internal:set_signal(sighup, ignore),
+ os:set_signal(sighup, ignore),
ok = kill("HUP", OsPid),
ok = kill("HUP", OsPid),
ok = kill("HUP", OsPid),
@@ -129,13 +129,13 @@ t_sighup(_Config) ->
io:format("Msgs2: ~p~n", [Msgs2]),
[] = Msgs2,
%% reset to handle (it's the default)
- erts_internal:set_signal(sighup, handle),
+ os:set_signal(sighup, handle),
ok.
t_sigusr1(_Config) ->
Pid1 = setup_service(),
OsPid = os:getpid(),
- erts_internal:set_signal(sigusr1, handle),
+ os:set_signal(sigusr1, handle),
ok = kill("USR1", OsPid),
ok = kill("USR1", OsPid),
ok = kill("USR1", OsPid),
@@ -150,7 +150,7 @@ t_sigusr1(_Config) ->
ok = kill("USR1", OsPid),
%% ignore
Pid2 = setup_service(),
- erts_internal:set_signal(sigusr1, ignore),
+ os:set_signal(sigusr1, ignore),
ok = kill("USR1", OsPid),
ok = kill("USR1", OsPid),
ok = kill("USR1", OsPid),
@@ -158,13 +158,13 @@ t_sigusr1(_Config) ->
io:format("Msgs2: ~p~n", [Msgs2]),
[] = Msgs2,
%% reset to ignore (it's the default)
- erts_internal:set_signal(sigusr1, handle),
+ os:set_signal(sigusr1, handle),
ok.
t_sigusr2(_Config) ->
Pid1 = setup_service(),
OsPid = os:getpid(),
- erts_internal:set_signal(sigusr2, handle),
+ os:set_signal(sigusr2, handle),
ok = kill("USR2", OsPid),
ok = kill("USR2", OsPid),
ok = kill("USR2", OsPid),
@@ -179,7 +179,7 @@ t_sigusr2(_Config) ->
ok = kill("USR2", OsPid),
%% ignore
Pid2 = setup_service(),
- erts_internal:set_signal(sigusr2, ignore),
+ os:set_signal(sigusr2, ignore),
ok = kill("USR2", OsPid),
ok = kill("USR2", OsPid),
ok = kill("USR2", OsPid),
@@ -187,13 +187,13 @@ t_sigusr2(_Config) ->
io:format("Msgs2: ~p~n", [Msgs2]),
[] = Msgs2,
%% reset to ignore (it's the default)
- erts_internal:set_signal(sigusr2, ignore),
+ os:set_signal(sigusr2, ignore),
ok.
t_sigterm(_Config) ->
Pid1 = setup_service(),
OsPid = os:getpid(),
- erts_internal:set_signal(sigterm, handle),
+ os:set_signal(sigterm, handle),
ok = kill("TERM", OsPid),
ok = kill("TERM", OsPid),
ok = kill("TERM", OsPid),
@@ -208,7 +208,7 @@ t_sigterm(_Config) ->
ok = kill("TERM", OsPid),
%% ignore
Pid2 = setup_service(),
- erts_internal:set_signal(sigterm, ignore),
+ os:set_signal(sigterm, ignore),
ok = kill("TERM", OsPid),
ok = kill("TERM", OsPid),
ok = kill("TERM", OsPid),
@@ -216,13 +216,13 @@ t_sigterm(_Config) ->
io:format("Msgs2: ~p~n", [Msgs2]),
[] = Msgs2,
%% reset to handle (it's the default)
- erts_internal:set_signal(sigterm, handle),
+ os:set_signal(sigterm, handle),
ok.
t_sigchld(_Config) ->
Pid1 = setup_service(),
OsPid = os:getpid(),
- erts_internal:set_signal(sigchld, handle),
+ os:set_signal(sigchld, handle),
ok = kill("CHLD", OsPid),
ok = kill("CHLD", OsPid),
ok = kill("CHLD", OsPid),
@@ -237,7 +237,7 @@ t_sigchld(_Config) ->
ok = kill("CHLD", OsPid),
%% ignore
Pid2 = setup_service(),
- erts_internal:set_signal(sigchld, ignore),
+ os:set_signal(sigchld, ignore),
ok = kill("CHLD", OsPid),
ok = kill("CHLD", OsPid),
ok = kill("CHLD", OsPid),
@@ -245,19 +245,19 @@ t_sigchld(_Config) ->
io:format("Msgs2: ~p~n", [Msgs2]),
[] = Msgs2,
%% reset to handle (it's the default)
- erts_internal:set_signal(sigchld, ignore),
+ os:set_signal(sigchld, ignore),
ok.
t_sigalrm(_Config) ->
Pid1 = setup_service(),
- true = erts_internal:set_signal(sigalrm, handle),
+ ok = os:set_signal(sigalrm, handle),
ok = os_signal_SUITE:set_alarm(1),
receive after 3000 -> ok end,
Msgs1 = fetch_msgs(Pid1),
[{notify,sigalrm}] = Msgs1,
io:format("Msgs1: ~p~n", [Msgs1]),
- erts_internal:set_signal(sigalrm, ignore),
+ os:set_signal(sigalrm, ignore),
Pid2 = setup_service(),
ok = os_signal_SUITE:set_alarm(1),
receive after 3000 -> ok end,
@@ -265,18 +265,18 @@ t_sigalrm(_Config) ->
[] = Msgs2,
io:format("Msgs2: ~p~n", [Msgs2]),
Pid3 = setup_service(),
- erts_internal:set_signal(sigalrm, handle),
+ os:set_signal(sigalrm, handle),
ok = os_signal_SUITE:set_alarm(1),
receive after 3000 -> ok end,
Msgs3 = fetch_msgs(Pid3),
[{notify,sigalrm}] = Msgs3,
io:format("Msgs3: ~p~n", [Msgs3]),
- erts_internal:set_signal(sigalrm, ignore),
+ os:set_signal(sigalrm, ignore),
ok.
t_sigchld_fork(_Config) ->
Pid1 = setup_service(),
- true = erts_internal:set_signal(sigchld, handle),
+ ok = os:set_signal(sigchld, handle),
{ok,OsPid} = os_signal_SUITE:fork(),
receive after 3000 -> ok end,
Msgs1 = fetch_msgs(Pid1),
@@ -286,7 +286,7 @@ t_sigchld_fork(_Config) ->
io:format("exit status from ~w : ~w~n", [OsPid,Status]),
42 = Status,
%% reset to ignore (it's the default)
- erts_internal:set_signal(sigchld, ignore),
+ os:set_signal(sigchld, ignore),
ok.