aboutsummaryrefslogtreecommitdiffstats
path: root/erts/emulator/nifs/common
diff options
context:
space:
mode:
authorMicael Karlberg <[email protected]>2019-05-20 14:38:56 +0200
committerMicael Karlberg <[email protected]>2019-05-29 13:47:40 +0200
commit2eb1dd7b5ee49401aae3c8db185cd3bf659ea0ab (patch)
tree99e15d189dbbd60d867f4303bbaadb4254bc8e3c /erts/emulator/nifs/common
parentda690a3c9857413943ab8534e27ab9a2ff54a4cb (diff)
downloadotp-2eb1dd7b5ee49401aae3c8db185cd3bf659ea0ab.tar.gz
otp-2eb1dd7b5ee49401aae3c8db185cd3bf659ea0ab.tar.bz2
otp-2eb1dd7b5ee49401aae3c8db185cd3bf659ea0ab.zip
[esock] Make sure AF_LOCAL exist before using
Add if-def for AF_LOCAL before using the flag. OTP-15822
Diffstat (limited to 'erts/emulator/nifs/common')
-rw-r--r--erts/emulator/nifs/common/socket_nif.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/erts/emulator/nifs/common/socket_nif.c b/erts/emulator/nifs/common/socket_nif.c
index 2562399fd0..25bc712949 100644
--- a/erts/emulator/nifs/common/socket_nif.c
+++ b/erts/emulator/nifs/common/socket_nif.c
@@ -10977,11 +10977,15 @@ ERL_NIF_TERM ngetopt_otp_protocol(ErlNifEnv* env,
switch (val) {
case IPPROTO_IP:
+#if defined(AF_LOCAL)
if (descP->domain == AF_LOCAL) {
result = esock_make_ok2(env, esock_atom_default);
} else {
result = esock_make_ok2(env, esock_atom_ip);
}
+#else
+ result = esock_make_ok2(env, esock_atom_ip);
+#endif
break;
case IPPROTO_TCP:
@@ -11553,10 +11557,14 @@ ERL_NIF_TERM ngetopt_lvl_sock_protocol(ErlNifEnv* env,
} else {
switch (val) {
case IPPROTO_IP:
+#if defined(AF_LOCAL)
if (descP->domain == AF_LOCAL)
result = esock_make_ok2(env, esock_atom_default);
else
result = esock_make_ok2(env, esock_atom_ip);
+#else
+ result = esock_make_ok2(env, esock_atom_ip);
+#endif
break;
case IPPROTO_TCP: