util: Refactor FileCommit from an #if sequence nested in #else, to a sequence of #elif

This should not change the actual code generation.
This commit is contained in:
Evan Klitzke authored and Luke Dashjr committed 2020-08-25 16:46:20 +00:00
1 parent c4b85ba704
commit f6cec0bcaf
1 file changed
+1 -3
+1 -3
View File
@@ -1024,8 +1024,7 @@ bool FileCommit(FILE *file)
LogPrintf("%s: FlushFileBuffers failed: %d\n", __func__, GetLastError()); LogPrintf("%s: FlushFileBuffers failed: %d\n", __func__, GetLastError());
return false; return false;
} }
#else #elif HAVE_FDATASYNC
#if HAVE_FDATASYNC
if (fdatasync(fileno(file)) != 0 && errno != EINVAL) { // Ignore EINVAL for filesystems that don't support sync if (fdatasync(fileno(file)) != 0 && errno != EINVAL) { // Ignore EINVAL for filesystems that don't support sync
LogPrintf("%s: fdatasync failed: %d\n", __func__, errno); LogPrintf("%s: fdatasync failed: %d\n", __func__, errno);
return false; return false;
@@ -1041,7 +1040,6 @@ bool FileCommit(FILE *file)
return false; return false;
} }
#endif #endif
#endif
return true; return true;
} }