mirror of
https://github.com/openwrt/openwrt.git
synced 2025-02-01 16:58:22 +00:00
tools/squashfskit4: fix build on non-linux systems
The xattr related function calls are linux specific Signed-off-by: Felix Fietkau <nbd@nbd.name> Signed-off-by: maurerr <mariusd84@gmail.com>
This commit is contained in:
parent
fa4898adc6
commit
6548e5c4be
37
tools/squashfskit4/patches/0010-portability.patch
Normal file
37
tools/squashfskit4/patches/0010-portability.patch
Normal file
@ -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
|
||||
}
|
Loading…
x
Reference in New Issue
Block a user