mirror of https://github.com/BOINC/boinc.git
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:
parent
3320af26e1
commit
447a33f76d
|
@ -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;
|
||||
|
|
Loading…
Reference in New Issue