Unverified Commit e92363e2 authored by Ted Lyngmo's avatar Ted Lyngmo Committed by GitHub
Browse files

Log the real reason for why posix_fadvise failed (#13246)



`reclaimFilePageCache` did not set `errno` but `rdbSaveInternal` which
is logging the error assumed it did. This makes sure `errno` is set.

Fixes #13245
Signed-off-by: default avatarTed Lyngmo <ted@lyncon.se>
parent 9ffc35c9
......@@ -1176,7 +1176,10 @@ int fsyncFileDir(const char *filename) {
int reclaimFilePageCache(int fd, size_t offset, size_t length) {
#ifdef HAVE_FADVISE
int ret = posix_fadvise(fd, offset, length, POSIX_FADV_DONTNEED);
if (ret) return -1;
if (ret) {
errno = ret;
return -1;
}
return 0;
#else
UNUSED(fd);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment