Whamcloud - gitweb
Remove explicit #define of _FILE_OFFSET_BITS
authorTheodore Ts'o <tytso@mit.edu>
Tue, 30 Apr 2024 23:54:08 +0000 (19:54 -0400)
committerTheodore Ts'o <tytso@mit.edu>
Tue, 30 Apr 2024 23:54:08 +0000 (19:54 -0400)
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 <tytso@mit.edu>
lib/ext2fs/getenv.c
lib/ext2fs/unix_io.c
misc/create_inode.c
misc/create_inode_libarchive.c
misc/e2fuzz.c
misc/findsuper.c
misc/fuse2fs.c
util/symlinks.c

index f279f7b..409a78a 100644 (file)
 #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
index b06df06..4b4f25a 100644 (file)
@@ -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
index e2676a0..4e292a2 100644 (file)
@@ -9,7 +9,6 @@
  * %End-Header%
  */
 
-#define _FILE_OFFSET_BITS       64
 #define _LARGEFILE64_SOURCE     1
 #define _GNU_SOURCE            1
 
index ebd62d4..8705eb1 100644 (file)
@@ -9,7 +9,6 @@
  * %End-Header%
  */
 
-#define _FILE_OFFSET_BITS 64
 #define _LARGEFILE64_SOURCE 1
 #define _GNU_SOURCE 1
 
index 0ceece9..9f60bcf 100644 (file)
@@ -9,7 +9,6 @@
  * %End-Header%
  */
 #define _XOPEN_SOURCE          600
-#define _FILE_OFFSET_BITS       64
 #define _LARGEFILE64_SOURCE     1
 #define _GNU_SOURCE            1
 
index 1f5c3e7..8f275ea 100644 (file)
@@ -81,8 +81,6 @@
  *
  */
 
-#define _FILE_OFFSET_BITS 64
-
 #include "config.h"
 #include <stdio.h>
 #include <stdlib.h>
index 5927fdf..56a0d54 100644 (file)
@@ -8,7 +8,6 @@
  * License.
  * %End-Header%
  */
-#define _FILE_OFFSET_BITS 64
 #ifndef _GNU_SOURCE
 #define _GNU_SOURCE
 #endif
index e9d2b01..4c72156 100644 (file)
@@ -1,11 +1,3 @@
-#define _FILE_OFFSET_BITS 64
-#ifndef _LARGEFILE_SOURCE
-#define _LARGEFILE_SOURCE
-#endif
-#ifndef _LARGEFILE64_SOURCE
-#define _LARGEFILE64_SOURCE
-#endif
-
 #include <unistd.h>
 #ifndef _POSIX_SOURCE
 #define _POSIX_SOURCE