mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-05-03 00:10:52 +02:00
Bugfix: Define and use HAVE_FDATASYNC correctly outside LevelDB
This commit is contained in:
parent
e9b3012654
commit
c4b85ba704
@ -1039,13 +1039,13 @@ AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <stdint.h>
|
||||
[ AC_MSG_RESULT(no)]
|
||||
)
|
||||
|
||||
dnl LevelDB platform checks
|
||||
AC_MSG_CHECKING(for fdatasync)
|
||||
AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <unistd.h>]],
|
||||
[[ fdatasync(0); ]])],
|
||||
[ AC_MSG_RESULT(yes); HAVE_FDATASYNC=1 ],
|
||||
[ AC_MSG_RESULT(no); HAVE_FDATASYNC=0 ]
|
||||
)
|
||||
AC_DEFINE_UNQUOTED([HAVE_FDATASYNC], [$HAVE_FDATASYNC], [Define to 1 if fdatasync is available.])
|
||||
|
||||
AC_MSG_CHECKING(for F_FULLFSYNC)
|
||||
AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <fcntl.h>]],
|
||||
|
@ -1025,7 +1025,7 @@ bool FileCommit(FILE *file)
|
||||
return false;
|
||||
}
|
||||
#else
|
||||
#if defined(HAVE_FDATASYNC)
|
||||
#if 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;
|
||||
|
Loading…
x
Reference in New Issue
Block a user