diff --git a/src/util/system.cpp b/src/util/system.cpp index 8164e884b17..e63f2e5c708 100644 --- a/src/util/system.cpp +++ b/src/util/system.cpp @@ -1021,7 +1021,7 @@ bool FileCommit(FILE *file) return false; } #else - #if defined(__linux__) || defined(__NetBSD__) + #if defined(HAVE_FDATASYNC) if (fdatasync(fileno(file)) != 0 && errno != EINVAL) { // Ignore EINVAL for filesystems that don't support sync LogPrintf("%s: fdatasync failed: %d\n", __func__, errno); return false;