Log the real reason for why posix_fadvise failed (#430)
`reclaimFilePageCache` did not set `errno` but `rdbSaveInternal` which is logging the error assumed it did. This makes sure `errno` is set. Signed-off-by: Ted Lyngmo <ted@lyncon.se>
This commit is contained in:
parent
50eefd647d
commit
2be94e68e8
@ -1138,7 +1138,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);
|
||||
|
Loading…
x
Reference in New Issue
Block a user