From a5bfb0a58783c472887ce0ad2060e4a395aa941d Mon Sep 17 00:00:00 2001 From: Lukas Larsson Date: Fri, 12 Sep 2014 12:06:34 +0200 Subject: erts: getsockname is not allowed on non-bound sockets This only produces an error on win32, but should not really be called on *nix either. --- lib/kernel/test/gen_tcp_api_SUITE_data/gen_tcp_api_SUITE.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'lib/kernel/test') 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 +#define sock_close(s) closesocket(s) #else #include +#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); } -- cgit v1.2.3