aboutsummaryrefslogtreecommitdiffstats
path: root/tools/squashfskit4
diff options
context:
space:
mode:
authorFelix Fietkau <nbd@nbd.name>2020-09-01 15:37:14 +0200
committerFelix Fietkau <nbd@nbd.name>2020-09-01 17:01:56 +0200
commit7f0cb91d713245f4c4534ab6214ce023245d16b1 (patch)
treedcedd8dfd9d9df01d0781c2c986013f99b915644 /tools/squashfskit4
parent91fb3ce56ba1a79a8368012cdcd161e861778b9a (diff)
downloadupstream-7f0cb91d713245f4c4534ab6214ce023245d16b1.tar.gz
upstream-7f0cb91d713245f4c4534ab6214ce023245d16b1.tar.bz2
upstream-7f0cb91d713245f4c4534ab6214ce023245d16b1.zip
tools/squashfskit4: fix build on non-linux systems
The xattr related function calls are linux specific Signed-off-by: Felix Fietkau <nbd@nbd.name>
Diffstat (limited to 'tools/squashfskit4')
-rw-r--r--tools/squashfskit4/patches/0010-portability.patch37
1 files changed, 37 insertions, 0 deletions
diff --git a/tools/squashfskit4/patches/0010-portability.patch b/tools/squashfskit4/patches/0010-portability.patch
new file mode 100644
index 0000000000..2cc50ae8f0
--- /dev/null
+++ b/tools/squashfskit4/patches/0010-portability.patch
@@ -0,0 +1,37 @@
+--- a/squashfs-tools/xattr.c
++++ b/squashfs-tools/xattr.c
+@@ -113,6 +113,7 @@ static int get_prefix(struct xattr_list
+
+ static int read_xattrs_from_system(char *filename, struct xattr_list **xattrs)
+ {
++#if defined(linux)
+ ssize_t size, vsize;
+ char *xattr_names, *p;
+ int i;
+@@ -222,6 +223,10 @@ failed:
+ free(xattr_list);
+ free(xattr_names);
+ return 0;
++#else
++ *xattrs = NULL;
++ return 0;
++#endif
+ }
+
+
+--- a/squashfs-tools/unsquashfs_xattr.c
++++ b/squashfs-tools/unsquashfs_xattr.c
+@@ -34,6 +34,7 @@ extern int user_xattrs;
+
+ void write_xattr(char *pathname, unsigned int xattr)
+ {
++#if defined(linux)
+ unsigned int count;
+ struct xattr_list *xattr_list;
+ int i;
+@@ -136,4 +137,5 @@ void write_xattr(char *pathname, unsigne
+ }
+
+ free_xattr(xattr_list, count);
++#endif
+ }