diff options
author | Micael Karlberg <[email protected]> | 2019-05-17 12:04:48 +0200 |
---|---|---|
committer | Micael Karlberg <[email protected]> | 2019-05-29 13:47:40 +0200 |
commit | 5345f3d6fcb78acbe65803109f035cc979ad2199 (patch) | |
tree | e6344393b0f48357b8e42d39a443812d5511a6b2 /erts/emulator/nifs/common | |
parent | 3ec5549972b672b0d177fb1eeb89addf184c13ef (diff) | |
download | otp-5345f3d6fcb78acbe65803109f035cc979ad2199.tar.gz otp-5345f3d6fcb78acbe65803109f035cc979ad2199.tar.bz2 otp-5345f3d6fcb78acbe65803109f035cc979ad2199.zip |
[esock] Fixed check domain local and specs
Fixed the spec's for function open/3,4.
Also, corrected the test for retreiving resulting
protocol when performing open with proto = 0 (default)
and domain is not local. Local may not be defined
on all platforms.
OTP-15822
Diffstat (limited to 'erts/emulator/nifs/common')
-rw-r--r-- | erts/emulator/nifs/common/socket_nif.c | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/erts/emulator/nifs/common/socket_nif.c b/erts/emulator/nifs/common/socket_nif.c index c1c72e525f..340111f76c 100644 --- a/erts/emulator/nifs/common/socket_nif.c +++ b/erts/emulator/nifs/common/socket_nif.c @@ -4490,7 +4490,11 @@ ERL_NIF_TERM nopen(ErlNifEnv* env, * local (AF_LOCAL) we need to explicitly get the protocol here! */ - if ((proto != 0) && (domain != AF_LOCAL)) + if ((proto == 0) +#if defined(AF_LOCAL) + && (domain != AF_LOCAL) +#endif + ) if (!nopen_which_protocol(sock, &proto)) { if (proto == ESOCK_WHICH_PROTO_ERROR) { save_errno = sock_errno(); @@ -4501,7 +4505,7 @@ ERL_NIF_TERM nopen(ErlNifEnv* env, while ((sock_close(sock) == INVALID_SOCKET) && (sock_errno() == EINTR)); return esock_make_error(env, esock_atom_eafnosupport); - } + } } |