From 4effc53bde629c3c238591a5ffbd0b90fd4186d9 Mon Sep 17 00:00:00 2001 From: Christian Beer Date: Wed, 4 Nov 2015 12:02:43 +0100 Subject: [PATCH] Lib: check return value of fcntl() fixes CID 27704 found by Coverity --- lib/network.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) 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; }