aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--erts/emulator/nifs/common/socket_nif.c8
-rw-r--r--erts/preloaded/ebin/socket.beambin70764 -> 70456 bytes
-rw-r--r--erts/preloaded/src/socket.erl13
3 files changed, 6 insertions, 15 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);
- }
+ }
}
diff --git a/erts/preloaded/ebin/socket.beam b/erts/preloaded/ebin/socket.beam
index 266adbd6f1..e37aa81b7c 100644
--- a/erts/preloaded/ebin/socket.beam
+++ b/erts/preloaded/ebin/socket.beam
Binary files differ
diff --git a/erts/preloaded/src/socket.erl b/erts/preloaded/src/socket.erl
index 03107d22b1..0f0d8f7a02 100644
--- a/erts/preloaded/src/socket.erl
+++ b/erts/preloaded/src/socket.erl
@@ -1016,12 +1016,6 @@ open(Domain, Type) ->
open(Domain, Type, default).
-spec open(Domain, Type, Protocol) -> {ok, Socket} | {error, Reason} when
- Domain :: local,
- Type :: stream | dgram,
- Protocol :: default,
- Socket :: socket(),
- Reason :: term();
- (Domain, Type, Protocol) -> {ok, Socket} | {error, Reason} when
Domain :: domain(),
Type :: type(),
Protocol :: default | protocol(),
@@ -1032,13 +1026,6 @@ open(Domain, Type, Protocol) ->
open(Domain, Type, Protocol, #{}).
-spec open(Domain, Type, Protocol, Extra) -> {ok, Socket} | {error, Reason} when
- Domain :: local,
- Type :: stream | dgram,
- Protocol :: default,
- Extra :: map(),
- Socket :: socket(),
- Reason :: term();
- (Domain, Type, Protocol, Extra) -> {ok, Socket} | {error, Reason} when
Domain :: domain(),
Type :: type(),
Protocol :: default | protocol(),