aboutsummaryrefslogtreecommitdiffstats
path: root/tools/squashfs4/patches/100-portability.patch
blob: fe804d447637c569cadee6ff99ce7d8432bb7f53 (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
32
33
34
35
36
37
--- a/squashfs-tools/xattr.c
+++ b/squashfs-tools/xattr.c
@@ -115,6 +115,7 @@ int xattr_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;
@@ -227,6 +228,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
@@ -36,6 +36,7 @@ extern int strict_errors;
 
 int write_xattr(char *pathname, unsigned int xattr)
 {
+#if defined(linux)
 	unsigned int count;
 	struct xattr_list *xattr_list;
 	int i;
@@ -147,4 +148,5 @@ int write_xattr(char *pathname, unsigned
 	free_xattr(xattr_list, count);
 
 	return !failed;
+#endif
 }