mirror of
https://github.com/dashpay/dash.git
synced 2024-12-27 04:52:59 +01:00
Merge #19614: util: use HAVE_FDATASYNC to determine fdatasync() use
1d8338d6b71447a5bf18750ca44724345aae5b60 util: use HAVE_FDATASYNC to determine fdatasync() use (fanquake) Pull request description: Rather than just using on Linux and NetBSD, use `fdatasync()` based on whether it's available. i.e `fdatasync` is available in newer versions of FreeBSD. This also aligns more closely with what is being done in leveldb. Was pointed out by Luke in #19430. ACKs for top commit: practicalswift: ACK 1d8338d6b71447a5bf18750ca44724345aae5b60 -- patch looks correct laanwj: ACK 1d8338d6b71447a5bf18750ca44724345aae5b60 hebasto: ACK 1d8338d6b71447a5bf18750ca44724345aae5b60 Tree-SHA512: 7dd6d87f5dc0c0ba21ae42f96b63fc12b34806cd536457fc4284f14bb8c235765344be228b000c6adf4cd1e8c4e6a03a18ca18ab22599c42cc3b706e0bcd1a17
This commit is contained in:
parent
72f2882efe
commit
682dba0245
@ -1092,7 +1092,7 @@ bool FileCommit(FILE *file)
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
#else
|
#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
|
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;
|
||||||
|
Loading…
Reference in New Issue
Block a user