Remove _LARGEFILE64_SOURCE, this is redundant when _FILE_OFFSET_BITS=64
additionally it fixes build with musl because the detection logic for
lseek64 fails because when using _LARGEFILE64_SOURCE musl also define's
lseek64 as an alias to lseek

Signed-off-by: Khem Raj <[email protected]>
---
 lib/libf2fs_io.c        | 4 +++-
 tools/f2fs_io/f2fs_io.c | 4 ++--
 2 files changed, 5 insertions(+), 3 deletions(-)

diff --git a/lib/libf2fs_io.c b/lib/libf2fs_io.c
index 1a8167d..abb43a3 100644
--- a/lib/libf2fs_io.c
+++ b/lib/libf2fs_io.c
@@ -11,7 +11,9 @@
  *
  * Dual licensed under the GPL or LGPL version 2 licenses.
  */
-#define _LARGEFILE64_SOURCE
+#ifndef _FILE_OFFSET_BITS
+#define _FILE_OFFSET_BITS 64
+#endif
 
 #include <stdio.h>
 #include <stdlib.h>
diff --git a/tools/f2fs_io/f2fs_io.c b/tools/f2fs_io/f2fs_io.c
index 6dcd840..cb99039 100644
--- a/tools/f2fs_io/f2fs_io.c
+++ b/tools/f2fs_io/f2fs_io.c
@@ -12,8 +12,8 @@
 #ifndef _LARGEFILE_SOURCE
 #define _LARGEFILE_SOURCE
 #endif
-#ifndef _LARGEFILE64_SOURCE
-#define _LARGEFILE64_SOURCE
+#ifndef _FILE_OFFSET_BITS
+#define _FILE_OFFSET_BITS 64
 #endif
 #ifndef O_LARGEFILE
 #define O_LARGEFILE 0
-- 
2.39.0



_______________________________________________
Linux-f2fs-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/linux-f2fs-devel

Reply via email to