Skip to content

Commit c4b85ba

Browse files
committed
Bugfix: Define and use HAVE_FDATASYNC correctly outside LevelDB
1 parent e9b3012 commit c4b85ba

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

configure.ac

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1039,13 +1039,13 @@ AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <stdint.h>
10391039
[ AC_MSG_RESULT(no)]
10401040
)
10411041

1042-
dnl LevelDB platform checks
10431042
AC_MSG_CHECKING(for fdatasync)
10441043
AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <unistd.h>]],
10451044
[[ fdatasync(0); ]])],
10461045
[ AC_MSG_RESULT(yes); HAVE_FDATASYNC=1 ],
10471046
[ AC_MSG_RESULT(no); HAVE_FDATASYNC=0 ]
10481047
)
1048+
AC_DEFINE_UNQUOTED([HAVE_FDATASYNC], [$HAVE_FDATASYNC], [Define to 1 if fdatasync is available.])
10491049

10501050
AC_MSG_CHECKING(for F_FULLFSYNC)
10511051
AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <fcntl.h>]],

src/util/system.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1025,7 +1025,7 @@ bool FileCommit(FILE *file)
10251025
return false;
10261026
}
10271027
#else
1028-
#if defined(HAVE_FDATASYNC)
1028+
#if HAVE_FDATASYNC
10291029
if (fdatasync(fileno(file)) != 0 && errno != EINVAL) { // Ignore EINVAL for filesystems that don't support sync
10301030
LogPrintf("%s: fdatasync failed: %d\n", __func__, errno);
10311031
return false;

0 commit comments

Comments
 (0)