diff --git a/src/inet/InetInterface.cpp b/src/inet/InetInterface.cpp index db10bdba3ed769..af89de8cb96822 100644 --- a/src/inet/InetInterface.cpp +++ b/src/inet/InetInterface.cpp @@ -500,12 +500,12 @@ int GetIOCTLSocket() { int s; #ifdef SOCK_CLOEXEC - s = socket(AF_INET, SOCK_STREAM, SOCK_CLOEXEC); + s = socket(AF_INET, SOCK_STREAM | SOCK_CLOEXEC, 0); if (s < 0) #endif { s = socket(AF_INET, SOCK_STREAM, 0); - fcntl(s, O_CLOEXEC); + fcntl(s, F_SETFD, O_CLOEXEC); } if (!__sync_bool_compare_and_swap(&sIOCTLSocket, -1, s))