aboutsummaryrefslogtreecommitdiffstats
path: root/lib/kernel/test
diff options
context:
space:
mode:
authorLukas Larsson <[email protected]>2014-11-05 15:16:42 +0100
committerLukas Larsson <[email protected]>2014-11-05 15:16:42 +0100
commit0c23d76c650e3dca4935aaca2f2ea88b0e9a52ff (patch)
treef74d8c62fa530b3c5cf50f480a35b83b5c7ee5a1 /lib/kernel/test
parent7ed6eb5554bdf84da4549c9e6d38f85d8b397d33 (diff)
parent965187787f603181aadbe5effdbb8fa6dc90b9ac (diff)
downloadotp-0c23d76c650e3dca4935aaca2f2ea88b0e9a52ff.tar.gz
otp-0c23d76c650e3dca4935aaca2f2ea88b0e9a52ff.tar.bz2
otp-0c23d76c650e3dca4935aaca2f2ea88b0e9a52ff.zip
Merge branch 'maint'
* maint: erts: getsockname is not allowed on non-bound sockets
Diffstat (limited to 'lib/kernel/test')
-rw-r--r--lib/kernel/test/gen_tcp_api_SUITE_data/gen_tcp_api_SUITE.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/lib/kernel/test/gen_tcp_api_SUITE_data/gen_tcp_api_SUITE.c b/lib/kernel/test/gen_tcp_api_SUITE_data/gen_tcp_api_SUITE.c
index 73a6568b30..d774767624 100644
--- a/lib/kernel/test/gen_tcp_api_SUITE_data/gen_tcp_api_SUITE.c
+++ b/lib/kernel/test/gen_tcp_api_SUITE_data/gen_tcp_api_SUITE.c
@@ -26,8 +26,10 @@
#ifdef __WIN32__
#include <winsock2.h>
+#define sock_close(s) closesocket(s)
#else
#include <sys/socket.h>
+#define sock_close(s) close(s)
#endif
#define sock_open(af, type, proto) socket((af), (type), (proto))
@@ -46,7 +48,7 @@ static ERL_NIF_TERM closesockfd(ErlNifEnv* env, int argc, const ERL_NIF_TERM arg
enif_get_int(env, argv[0], &fd);
- close(fd);
+ sock_close(fd);
return enif_make_int(env, fd);
}