From 3fbb54681eaf71422517364eb3778daaeb8830c1 Mon Sep 17 00:00:00 2001
From: begasus <begasus@gmail.com>
Date: Sun, 7 Nov 2021 08:39:42 +0000
Subject: Fix build


diff --git a/configure.ac b/configure.ac
index 9b958ff..fd94d05 100644
--- a/configure.ac
+++ b/configure.ac
@@ -135,7 +135,7 @@ fi
 AC_CHECK_FUNC([execve], [], [AC_MSG_ERROR([execve() function not found.])])
 AC_CHECK_FUNC([execvp], [], [AC_MSG_ERROR([execvp() function not found.])])
 AC_CHECK_FUNC([exit], [], [AC_MSG_ERROR([exit() function not found.])])
-AC_CHECK_FUNC([fdatasync], [], [AC_MSG_ERROR([fdatasync() function not found.])])
+AC_CHECK_FUNC([fsync], [], [AC_MSG_ERROR([fsync() function not found.])])
 AC_CHECK_FUNC([fclose], [], [AC_MSG_ERROR([fclose() function not found.])])
 AC_CHECK_FUNC([fdopen], [], [AC_MSG_ERROR([fdopen() function not found.])])
 AC_CHECK_FUNC([feof], [], [AC_MSG_ERROR([feof() function not found.])])
diff --git a/src/compat/os.c b/src/compat/os.c
index c3d5d09..a0be0e6 100644
--- a/src/compat/os.c
+++ b/src/compat/os.c
@@ -357,7 +357,7 @@ os_fdatasync(int fd)
 	/* OS X system might not have fdatasync(). */
 	return fcntl(fd, F_FULLFSYNC);
 #else
-	return fdatasync(fd);
+	return fsync(fd);
 #endif
 }
 
-- 
2.30.2

