diff --git a/lib/network.cpp b/lib/network.cpp index 1696695f87..82e8975844 100644 --- a/lib/network.cpp +++ b/lib/network.cpp @@ -225,7 +225,9 @@ int boinc_socket(int& fd, int protocol) { return ERR_SOCKET; } #ifndef _WIN32 - fcntl(fd, F_SETFD, FD_CLOEXEC); + if (-1 == fcntl(fd, F_SETFD, FD_CLOEXEC)) { + return ERR_FCNTL; + } #endif return 0; }