[vlc-devel] [PATCH] contrib: libarchive: fix the missing statvfs patch

Steve Lhomme robux4 at ycbcr.xyz
Fri Apr 3 09:39:20 CEST 2020


The code assumed that statfs had a f_flag field in some places (but not others)
but it's in fact it's f_flags.

Android compiles fine with this patch (and all other targets in Gitlab CI)
---
 ...01-Fix-build-failure-without-STATVFS.patch | 64 +++++++++++++------
 1 file changed, 46 insertions(+), 18 deletions(-)

diff --git a/contrib/src/libarchive/0001-Fix-build-failure-without-STATVFS.patch b/contrib/src/libarchive/0001-Fix-build-failure-without-STATVFS.patch
index 6cfaef1acd4..93274f316e8 100644
--- a/contrib/src/libarchive/0001-Fix-build-failure-without-STATVFS.patch
+++ b/contrib/src/libarchive/0001-Fix-build-failure-without-STATVFS.patch
@@ -1,27 +1,55 @@
-From a189efa30ad57c874997dc3ea2a3cef402b6a4ea Mon Sep 17 00:00:00 2001
-From: Thomas Guillem <thomas at gllm.fr>
-Date: Fri, 22 May 2015 14:44:28 +0200
-Subject: [PATCH] Fix build failure without STATVFS
+From 1716cb9bb754b8baf630b8b79b94461611ab1a61 Mon Sep 17 00:00:00 2001
+From: Steve Lhomme <robux4 at ycbcr.xyz>
+Date: Fri, 3 Apr 2020 08:33:02 +0200
+Subject: [PATCH 6/6] fix f_flag usage in statfs
 
+statfs has a f_flags field, not f_flag [1]
+statvfs is the one with the f_flag field [2]
+
+[1] https://github.com/torvalds/linux/blob/master/fs/statfs.c
+[2] http://man7.org/linux/man-pages/man3/statvfs.3.html
 ---
- libarchive/archive_read_disk_posix.c | 4 +++-
- 1 file changed, 3 insertions(+), 1 deletion(-)
+ libarchive/archive_read_disk_posix.c | 8 ++++----
+ 1 file changed, 4 insertions(+), 4 deletions(-)
 
 diff --git a/libarchive/archive_read_disk_posix.c b/libarchive/archive_read_disk_posix.c
-index a13dbbf..b93c198 100644
+index be29c981..66a529a9 100644
 --- a/libarchive/archive_read_disk_posix.c
 +++ b/libarchive/archive_read_disk_posix.c
-@@ -1640,7 +1640,9 @@ setup_current_filesystem(struct archive_read_disk *a)
- }
+@@ -1700,13 +1700,13 @@ setup_current_filesystem(struct archive_read_disk *a)
+ 		t->current_filesystem->incr_xfer_size = sfs.f_bsize;
+ #endif
+ 	}
+-	if (sfs.f_flag & ST_LOCAL)
++	if (sfs.f_flags & ST_LOCAL)
+ 		t->current_filesystem->remote = 0;
+ 	else
+ 		t->current_filesystem->remote = 1;
+ 
+ #if defined(ST_NOATIME)
+-	if (sfs.f_flag & ST_NOATIME)
++	if (sfs.f_flags & ST_NOATIME)
+ 		t->current_filesystem->noatime = 1;
+ 	else
+ #endif
+@@ -1844,7 +1844,7 @@ setup_current_filesystem(struct archive_read_disk *a)
+ #if defined(HAVE_STATVFS)
+ 	if (svfs.f_flag & ST_NOATIME)
+ #else
+-	if (sfs.f_flag & ST_NOATIME)
++	if (sfs.f_flags & ST_NOATIME)
+ #endif
+ 		t->current_filesystem->noatime = 1;
+ 	else
+@@ -1929,7 +1929,7 @@ setup_current_filesystem(struct archive_read_disk *a)
+ 	}
  
- #elif defined(HAVE_SYS_STATFS_H) && defined(HAVE_LINUX_MAGIC_H) &&\
--	defined(HAVE_STATFS) && defined(HAVE_FSTATFS)
-+	defined(HAVE_STATFS) && defined(HAVE_FSTATFS) &&\
-+	defined(HAVE_SYS_STATVFS_H) &&\
-+	(defined(HAVE_STATVFS) || defined(HAVE_FSTATVFS))
- /*
-  * Note: statfs is deprecated since LSB 3.2
-  */
+ #if defined(ST_NOATIME)
+-	if (sfs.f_flag & ST_NOATIME)
++	if (sfs.f_flags & ST_NOATIME)
+ 		t->current_filesystem->noatime = 1;
+ 	else
+ #endif
 -- 
-2.1.4
+2.26.0.windows.1
 
-- 
2.17.1



More information about the vlc-devel mailing list