aboutsummaryrefslogtreecommitdiffstats
path: root/erts/emulator/test
diff options
context:
space:
mode:
authorSverker Eriksson <[email protected]>2017-02-09 17:30:30 +0100
committerSverker Eriksson <[email protected]>2017-02-09 17:30:30 +0100
commita8d5234c77634df9522727ff200cef4fcab49c22 (patch)
tree51c3d51eaab4510928d0439265eb0613bac3a68d /erts/emulator/test
parentd85e74e0c0e4bc66c875e2fd5f54d89255df0047 (diff)
downloadotp-a8d5234c77634df9522727ff200cef4fcab49c22.tar.gz
otp-a8d5234c77634df9522727ff200cef4fcab49c22.tar.bz2
otp-a8d5234c77634df9522727ff200cef4fcab49c22.zip
erts: Change return value for enif_select
to negative int as error and positive as success.
Diffstat (limited to 'erts/emulator/test')
-rw-r--r--erts/emulator/test/nif_SUITE.erl9
-rw-r--r--erts/emulator/test/nif_SUITE_data/nif_SUITE.c4
2 files changed, 6 insertions, 7 deletions
diff --git a/erts/emulator/test/nif_SUITE.erl b/erts/emulator/test/nif_SUITE.erl
index de26e73c3d..d88ac01e46 100644
--- a/erts/emulator/test/nif_SUITE.erl
+++ b/erts/emulator/test/nif_SUITE.erl
@@ -457,11 +457,10 @@ t_on_load(Config) when is_list(Config) ->
-define(ERL_NIF_SELECT_WRITE, (1 bsl 1)).
-define(ERL_NIF_SELECT_STOP, (1 bsl 2)).
--define(ERL_NIF_SELECT_ERROR, (1 bsl 0)).
--define(ERL_NIF_SELECT_STOP_CALLED, (1 bsl 1)).
--define(ERL_NIF_SELECT_STOP_SCHEDULED, (1 bsl 2)).
--define(ERL_NIF_SELECT_INVALID_EVENT, (1 bsl 3)).
--define(ERL_NIF_SELECT_FAILED, (1 bsl 4)).
+-define(ERL_NIF_SELECT_STOP_CALLED, (1 bsl 0)).
+-define(ERL_NIF_SELECT_STOP_SCHEDULED, (1 bsl 1)).
+-define(ERL_NIF_SELECT_INVALID_EVENT, (1 bsl 2)).
+-define(ERL_NIF_SELECT_FAILED, (1 bsl 3)).
select(Config) when is_list(Config) ->
diff --git a/erts/emulator/test/nif_SUITE_data/nif_SUITE.c b/erts/emulator/test/nif_SUITE_data/nif_SUITE.c
index 6cf02c6efe..05b4b05e16 100644
--- a/erts/emulator/test/nif_SUITE_data/nif_SUITE.c
+++ b/erts/emulator/test/nif_SUITE_data/nif_SUITE.c
@@ -2123,7 +2123,7 @@ static ERL_NIF_TERM select_nif(ErlNifEnv* env, int argc, const ERL_NIF_TERM argv
void* obj;
ErlNifPid nifpid, *pid = NULL;
ERL_NIF_TERM ref;
- enum ErlNifSelectReturn retval;
+ int retval;
if (!get_fd(env, argv[0], &fdr)
|| !enif_get_uint(env, argv[1], &mode)
@@ -2143,7 +2143,7 @@ static ERL_NIF_TERM select_nif(ErlNifEnv* env, int argc, const ERL_NIF_TERM argv
enif_self(env, &fdr->pid);
retval = enif_select(env, fdr->fd, mode, obj, pid, ref);
- return enif_make_int(env, (int)retval);
+ return enif_make_int(env, retval);
}
static ERL_NIF_TERM pipe_nif(ErlNifEnv* env, int argc, const ERL_NIF_TERM argv[])