mirror of
https://github.com/bitcoin/bitcoin.git
synced 2024-11-20 02:25:40 +01:00
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:
parent
c4b85ba704
commit
f6cec0bcaf
@ -1024,23 +1024,21 @@ bool FileCommit(FILE *file)
|
||||
LogPrintf("%s: FlushFileBuffers failed: %d\n", __func__, GetLastError());
|
||||
return false;
|
||||
}
|
||||
#else
|
||||
#if HAVE_FDATASYNC
|
||||
#elif 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;
|
||||
}
|
||||
#elif defined(MAC_OSX) && defined(F_FULLFSYNC)
|
||||
#elif defined(MAC_OSX) && defined(F_FULLFSYNC)
|
||||
if (fcntl(fileno(file), F_FULLFSYNC, 0) == -1) { // Manpage says "value other than -1" is returned on success
|
||||
LogPrintf("%s: fcntl F_FULLFSYNC failed: %d\n", __func__, errno);
|
||||
return false;
|
||||
}
|
||||
#else
|
||||
#else
|
||||
if (fsync(fileno(file)) != 0 && errno != EINVAL) {
|
||||
LogPrintf("%s: fsync failed: %d\n", __func__, errno);
|
||||
return false;
|
||||
}
|
||||
#endif
|
||||
#endif
|
||||
return true;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user