diff options
author | Björn-Egil Dahlberg <[email protected]> | 2017-01-24 10:59:30 +0100 |
---|---|---|
committer | Björn-Egil Dahlberg <[email protected]> | 2017-02-02 09:40:28 +0100 |
commit | d4bd17da9759af54227891a90d9fb83d5bfe6d7e (patch) | |
tree | a1b75a3b750b073d46e7a34bfe4a80eddc62a02e /erts/emulator/beam/erl_bif_os.c | |
parent | 9ccb988eeb79815a33e0dd138278e0c29ed3ca6a (diff) | |
download | otp-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/beam/erl_bif_os.c')
-rw-r--r-- | erts/emulator/beam/erl_bif_os.c | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/erts/emulator/beam/erl_bif_os.c b/erts/emulator/beam/erl_bif_os.c index 46777d3aa5..edc3c82b23 100644 --- a/erts/emulator/beam/erl_bif_os.c +++ b/erts/emulator/beam/erl_bif_os.c @@ -203,3 +203,17 @@ BIF_RETTYPE os_unsetenv_1(BIF_ALIST_1) } BIF_RET(am_true); } + +BIF_RETTYPE os_set_signal_2(BIF_ALIST_2) { + if (is_atom(BIF_ARG_1) && ((BIF_ARG_2 == am_ignore) || + (BIF_ARG_2 == am_default) || + (BIF_ARG_2 == am_handle))) { + if (!erts_set_signal(BIF_ARG_1, BIF_ARG_2)) + goto error; + + BIF_RET(am_ok); + } + +error: + BIF_ERROR(BIF_P, BADARG); +} |