CID 743396 (#1 of 1): Unchecked return value from library (CHECKED_RETURN)
check_return: Calling function "posix_fadvise(fd, offset, bl->length(), 4)"
without checking return value. This library function may fail and return
an error code.
unchecked_value: No check of the return value of
"posix_fadvise(fd, offset, bl->length(), 4)".
Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
if (do_sync_file_range)
::sync_file_range(fd, offset, bl.length(),
SYNC_FILE_RANGE_WAIT_AFTER);
- if (do_fadvise)
- ::posix_fadvise(fd, offset, bl.length(),
- POSIX_FADV_DONTNEED);
+ if (do_fadvise) {
+ int fa_r = posix_fadvise(fd, offset, bl.length(), POSIX_FADV_DONTNEED);
+ if (fa_r) {
+ std::cout << "posix_fadvise failed, errno is: " << fa_r << std::endl;
+ }
+ }
::close(fd);
{
Mutex::Locker l(pending_commit_mutex);