aboutsummaryrefslogtreecommitdiff
path: root/extra/libarchive/patches/replace-namelen.patch
blob: ccc93be815fac3dbdc3aa802bdd2542d67ab0e6f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
From dbc79c26d1405537f1a83219289c871f3a8ce018 Mon Sep 17 00:00:00 2001
From: Wong Hoi Sing Edison <hswong3i@pantarei-design.com>
Date: Wed, 19 Jul 2023 16:27:19 +0800
Subject: [PATCH] Replace `svfs.f_namelen` with `svfs.f_namemax`

When compile 3.7.0 with CentOS 7 coming with below error message:

    libarchive/archive_read_disk_posix.c:1869:40: error: 'struct statvfs' has no member named 'f_namelen'

The equivalent for `f_namelen` in struct statvfs is `f_namemax`.

See http://landley.net/mantis/mantis-346.html

Signed-off-by: Wong Hoi Sing Edison <hswong3i@pantarei-design.com>
---
 libarchive/archive_read_disk_posix.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/libarchive/archive_read_disk_posix.c b/libarchive/archive_read_disk_posix.c
index e9657f6a7..8d5c32f03 100644
--- a/libarchive/archive_read_disk_posix.c
+++ b/libarchive/archive_read_disk_posix.c
@@ -1866,7 +1866,7 @@ setup_current_filesystem(struct archive_read_disk *a)
 #if defined(USE_READDIR_R)
 	/* Set maximum filename length. */
 #if defined(HAVE_STATVFS)
-	t->current_filesystem->name_max = svfs.f_namelen;
+	t->current_filesystem->name_max = svfs.f_namemax;
 #else
 	t->current_filesystem->name_max = sfs.f_namelen;
 #endif