From 207b6114630f0e0ab326923ef3cf354370027a68 Mon Sep 17 00:00:00 2001 From: "Sijmen J. Mulder" Date: Mon, 15 Jul 2024 23:01:08 +0200 Subject: [PATCH 1/3] Disable large file support on old glibc On glibc <2.23 fts.h doesn't support the feature: https://sourceware.org/bugzilla/show_bug.cgi?id=11460 --- src/nnn.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/nnn.c b/src/nnn.c index ccbebe742..544c388bf 100644 --- a/src/nnn.c +++ b/src/nnn.c @@ -28,13 +28,16 @@ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -#define _FILE_OFFSET_BITS 64 /* Support large files on 32-bit glibc */ - #if defined(__linux__) || defined(MINGW) || defined(__MINGW32__) \ || defined(__MINGW64__) || defined(__CYGWIN__) #ifndef _GNU_SOURCE #define _GNU_SOURCE #endif +#include /* __GLIBC__ etc */ +/* large file support on 32-bit glibc >= 2.23 where fts.h supports it */ +#if !defined(__GLIBC__) || __GLIBC__ > 2 || __GLIBC_MINOR__ >= 23 +#define _FILE_OFFSET_BITS 64 +#endif #if defined(__linux__) #include #define LINUX_INOTIFY From bb085435daef2371ba90237a641d7f697b1802cb Mon Sep 17 00:00:00 2001 From: "Sijmen J. Mulder" Date: Tue, 16 Jul 2024 09:24:25 +0200 Subject: [PATCH 2/3] Fix logic mistake Probably wouldn't occur in practice but glibc 1.23+ would also match the check. --- src/nnn.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/nnn.c b/src/nnn.c index 544c388bf..a4360971e 100644 --- a/src/nnn.c +++ b/src/nnn.c @@ -35,7 +35,7 @@ #endif #include /* __GLIBC__ etc */ /* large file support on 32-bit glibc >= 2.23 where fts.h supports it */ -#if !defined(__GLIBC__) || __GLIBC__ > 2 || __GLIBC_MINOR__ >= 23 +#if !defined(__GLIBC__) || __GLIBC__ > 2 || (__GLIBC__ == 2 && __GLIBC_MINOR__ >= 23) #define _FILE_OFFSET_BITS 64 #endif #if defined(__linux__) From 3e801d34ec4c9f6dfeb37059343c0d846833d796 Mon Sep 17 00:00:00 2001 From: "Sijmen J. Mulder" Date: Tue, 16 Jul 2024 09:26:35 +0200 Subject: [PATCH 3/3] Remove extraneous condition --- src/nnn.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/nnn.c b/src/nnn.c index a4360971e..8acc427da 100644 --- a/src/nnn.c +++ b/src/nnn.c @@ -35,7 +35,7 @@ #endif #include /* __GLIBC__ etc */ /* large file support on 32-bit glibc >= 2.23 where fts.h supports it */ -#if !defined(__GLIBC__) || __GLIBC__ > 2 || (__GLIBC__ == 2 && __GLIBC_MINOR__ >= 23) +#if __GLIBC__ > 2 || (__GLIBC__ == 2 && __GLIBC_MINOR__ >= 23) #define _FILE_OFFSET_BITS 64 #endif #if defined(__linux__)