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