aboutsummaryrefslogtreecommitdiffstats
path: root/lib/erl_interface/src/misc/ei_portio.c
diff options
context:
space:
mode:
authorRickard Green <[email protected]>2019-02-05 20:34:59 +0100
committerRickard Green <[email protected]>2019-02-05 20:34:59 +0100
commit320a02e522085fe5eec141d7bf18631e4ef74f0a (patch)
tree6f9ca128ea1a81d3c1be6e18bc7b59aa370d2e8e /lib/erl_interface/src/misc/ei_portio.c
parenta4641c5b3469d2e3cb9b0937ed941748fbbf2036 (diff)
parentdbeaca78bc6c0d4719a522e447fa59d7a1006ae0 (diff)
downloadotp-320a02e522085fe5eec141d7bf18631e4ef74f0a.tar.gz
otp-320a02e522085fe5eec141d7bf18631e4ef74f0a.tar.bz2
otp-320a02e522085fe5eec141d7bf18631e4ef74f0a.zip
Merge branch 'rickard/ei-ext/OTP-15442' into rickard/ei-ext-maint/OTP-15442
* rickard/ei-ext/OTP-15442: Introduce ei_init() Fix bug in ei_accept_tmo Fix build of erl_interface on BSD
Diffstat (limited to 'lib/erl_interface/src/misc/ei_portio.c')
-rw-r--r--lib/erl_interface/src/misc/ei_portio.c13
1 files changed, 8 insertions, 5 deletions
diff --git a/lib/erl_interface/src/misc/ei_portio.c b/lib/erl_interface/src/misc/ei_portio.c
index 726b1af82d..bccc86c1b1 100644
--- a/lib/erl_interface/src/misc/ei_portio.c
+++ b/lib/erl_interface/src/misc/ei_portio.c
@@ -19,6 +19,9 @@
*
*/
+
+#include "eidef.h"
+
#ifdef __WIN32__
#include <winsock2.h>
#include <windows.h>
@@ -47,10 +50,8 @@ static unsigned long param_one = 1;
#include <taskLib.h>
#include <inetLib.h>
#include <selectLib.h>
-#include <sys/types.h>
#include <ioLib.h>
#include <unistd.h>
-#include <sys/types.h>
#include <sys/socket.h>
#include <netinet/in.h>
#include <netinet/tcp.h>
@@ -65,7 +66,6 @@ static unsigned long param_one = 1;
#else /* other unix */
#include <stdlib.h>
-#include <sys/types.h>
#include <sys/socket.h>
#include <unistd.h>
#include <fcntl.h>
@@ -86,6 +86,7 @@ static unsigned long param_one = 1;
/* common includes */
+#include <sys/types.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
@@ -94,7 +95,9 @@ static unsigned long param_one = 1;
#else
#include <time.h>
#endif
-#include "eidef.h"
+#ifdef HAVE_SYS_SELECT_H
+#include <sys/select.h>
+#endif
#include "ei_portio.h"
#include "ei_internal.h"
@@ -246,7 +249,7 @@ static int tcp_accept(void **ctx, void *addr, int *len, unsigned unused)
if (res)
return res;
- res = accept(fd, (struct sockaddr*) &addr, &addr_len);
+ res = accept(fd, (struct sockaddr*) addr, &addr_len);
if (MEANS_SOCKET_ERROR(res))
return get_error();