From 1b09605a065fa3fe0c31914b0c63f3699e16d6b1 Mon Sep 17 00:00:00 2001 From: Leo Yuriev Date: Wed, 26 Jul 2017 12:18:17 +0300 Subject: [PATCH] mdbx: clarify mdbx_filesync(). Change-Id: I39029a52fd44c81901aff6114a5c58a62b92098b --- src/osal.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/osal.c b/src/osal.c index c4ecbd37..2f6301cc 100644 --- a/src/osal.c +++ b/src/osal.c @@ -621,9 +621,9 @@ int mdbx_write(mdbx_filehandle_t fd, const void *buf, size_t bytes) { } } -int mdbx_filesync(mdbx_filehandle_t fd, bool fullsync) { +int mdbx_filesync(mdbx_filehandle_t fd, bool filesize_changed) { #if defined(_WIN32) || defined(_WIN64) - (void)fullsync; + (void)filesize_changed; return FlushFileBuffers(fd) ? MDBX_SUCCESS : GetLastError(); #elif __GLIBC_PREREQ(2, 16) || _BSD_SOURCE || _XOPEN_SOURCE || \ (__GLIBC_PREREQ(2, 8) && _POSIX_C_SOURCE >= 200112L) @@ -640,10 +640,10 @@ int mdbx_filesync(mdbx_filehandle_t fd, bool fullsync) { * see http://www.spinics.net/lists/linux-ext4/msg33714.html */ #if _POSIX_C_SOURCE >= 199309L || _XOPEN_SOURCE >= 500 || \ defined(_POSIX_SYNCHRONIZED_IO) - if (!fullsync && fdatasync(fd) == 0) + if (!filesize_changed && fdatasync(fd) == 0) return MDBX_SUCCESS; #else - (void)fullsync; + (void)filesize_changed; #endif if (fsync(fd) == 0) return MDBX_SUCCESS;