From 3ab99d9b6022ffa369e8ce7ae5643a30028d0db1 Mon Sep 17 00:00:00 2001 From: Theodore Ts'o Date: Tue, 30 Apr 2024 19:54:08 -0400 Subject: [PATCH] Remove explicit #define of _FILE_OFFSET_BITS The problem with explicitly setting _FILE_OFFSET_BITS is that it's not necessarily a no-op on a 64-bit platform with a 64-bit off_t. Apparently glibc's mips64el which end up using a different structure definition for struct stat, and this causes a compatibility problem with libarchive. It's not needed on mips64el, since off_t is 64-bits, but it actually causes problems. So remove it, since we now use the autoconf's AC_SYS_LARGEFILE, which will set _FILE_OFFSET_BITS when it is necessary (such as on a 32-bit i386 Linux platform), and will skip it when it is unnecessary. Addresses-Debian-Bug: #1070042 Signed-off-by: Theodore Ts'o --- lib/ext2fs/getenv.c | 7 ------- lib/ext2fs/unix_io.c | 1 - misc/create_inode.c | 1 - misc/create_inode_libarchive.c | 1 - misc/e2fuzz.c | 1 - misc/findsuper.c | 2 -- misc/fuse2fs.c | 1 - util/symlinks.c | 8 -------- 8 files changed, 22 deletions(-) diff --git a/lib/ext2fs/getenv.c b/lib/ext2fs/getenv.c index f279f7b..409a78a 100644 --- a/lib/ext2fs/getenv.c +++ b/lib/ext2fs/getenv.c @@ -12,13 +12,6 @@ #if !defined(__FreeBSD__) && !defined(__NetBSD__) && !defined(__OpenBSD__) #define _XOPEN_SOURCE 600 #define _DARWIN_C_SOURCE -#define _FILE_OFFSET_BITS 64 -#ifndef _LARGEFILE_SOURCE -#define _LARGEFILE_SOURCE -#endif -#ifndef _LARGEFILE64_SOURCE -#define _LARGEFILE64_SOURCE -#endif #ifndef _GNU_SOURCE #define _GNU_SOURCE #endif diff --git a/lib/ext2fs/unix_io.c b/lib/ext2fs/unix_io.c index b06df06..4b4f25a 100644 --- a/lib/ext2fs/unix_io.c +++ b/lib/ext2fs/unix_io.c @@ -18,7 +18,6 @@ #if !defined(__FreeBSD__) && !defined(__NetBSD__) && !defined(__OpenBSD__) #define _XOPEN_SOURCE 600 #define _DARWIN_C_SOURCE -#define _FILE_OFFSET_BITS 64 #ifndef _LARGEFILE_SOURCE #define _LARGEFILE_SOURCE #endif diff --git a/misc/create_inode.c b/misc/create_inode.c index e2676a0..4e292a2 100644 --- a/misc/create_inode.c +++ b/misc/create_inode.c @@ -9,7 +9,6 @@ * %End-Header% */ -#define _FILE_OFFSET_BITS 64 #define _LARGEFILE64_SOURCE 1 #define _GNU_SOURCE 1 diff --git a/misc/create_inode_libarchive.c b/misc/create_inode_libarchive.c index ebd62d4..8705eb1 100644 --- a/misc/create_inode_libarchive.c +++ b/misc/create_inode_libarchive.c @@ -9,7 +9,6 @@ * %End-Header% */ -#define _FILE_OFFSET_BITS 64 #define _LARGEFILE64_SOURCE 1 #define _GNU_SOURCE 1 diff --git a/misc/e2fuzz.c b/misc/e2fuzz.c index 0ceece9..9f60bcf 100644 --- a/misc/e2fuzz.c +++ b/misc/e2fuzz.c @@ -9,7 +9,6 @@ * %End-Header% */ #define _XOPEN_SOURCE 600 -#define _FILE_OFFSET_BITS 64 #define _LARGEFILE64_SOURCE 1 #define _GNU_SOURCE 1 diff --git a/misc/findsuper.c b/misc/findsuper.c index 1f5c3e7..8f275ea 100644 --- a/misc/findsuper.c +++ b/misc/findsuper.c @@ -81,8 +81,6 @@ * */ -#define _FILE_OFFSET_BITS 64 - #include "config.h" #include #include diff --git a/misc/fuse2fs.c b/misc/fuse2fs.c index 5927fdf..56a0d54 100644 --- a/misc/fuse2fs.c +++ b/misc/fuse2fs.c @@ -8,7 +8,6 @@ * License. * %End-Header% */ -#define _FILE_OFFSET_BITS 64 #ifndef _GNU_SOURCE #define _GNU_SOURCE #endif diff --git a/util/symlinks.c b/util/symlinks.c index e9d2b01..4c72156 100644 --- a/util/symlinks.c +++ b/util/symlinks.c @@ -1,11 +1,3 @@ -#define _FILE_OFFSET_BITS 64 -#ifndef _LARGEFILE_SOURCE -#define _LARGEFILE_SOURCE -#endif -#ifndef _LARGEFILE64_SOURCE -#define _LARGEFILE64_SOURCE -#endif - #include #ifndef _POSIX_SOURCE #define _POSIX_SOURCE -- 1.8.3.1