diff options
Diffstat (limited to 'lib/kernel/test/gen_tcp_api_SUITE_data/gen_tcp_api_SUITE.c')
-rw-r--r-- | lib/kernel/test/gen_tcp_api_SUITE_data/gen_tcp_api_SUITE.c | 7 |
1 files changed, 4 insertions, 3 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 6be7838363..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 @@ -22,13 +22,14 @@ #include <string.h> #include <assert.h> #include <limits.h> -#include <sys/socket.h> #include <sys/types.h> #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)) @@ -47,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); } |