Lib: check return value of fcntl() in boinc_fopen()

There is no way to communicate what failed to the caller because they usually don't check the return value in the case of non-zero.
fixes CID 27690 found by Coverity
This commit is contained in:
Christian Beer 2015-11-04 16:44:47 +01:00
parent 3320af26e1
commit 447a33f76d
1 changed files with 3 additions and 1 deletions

View File

@ -504,7 +504,9 @@ FILE* boinc_fopen(const char* path, const char* mode) {
}
}
if (f) {
fcntl(fileno(f), F_SETFD, FD_CLOEXEC);
if (-1 == fcntl(fileno(f), F_SETFD, FD_CLOEXEC)) {
return 0;
}
}
#endif
return f;