Lib: check return value of fcntl()

fixes CID 27704 found by Coverity
This commit is contained in:
Christian Beer 2015-11-04 12:02:43 +01:00
parent 4c659dd00f
commit 4effc53bde
1 changed files with 3 additions and 1 deletions

View File

@ -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;
}