aboutsummaryrefslogtreecommitdiffstats
path: root/tools/squashfs4/patches/002-Mksquashfs-Make-sysinfo-conditional.patch
diff options
context:
space:
mode:
Diffstat (limited to 'tools/squashfs4/patches/002-Mksquashfs-Make-sysinfo-conditional.patch')
-rw-r--r--tools/squashfs4/patches/002-Mksquashfs-Make-sysinfo-conditional.patch30
1 files changed, 30 insertions, 0 deletions
diff --git a/tools/squashfs4/patches/002-Mksquashfs-Make-sysinfo-conditional.patch b/tools/squashfs4/patches/002-Mksquashfs-Make-sysinfo-conditional.patch
new file mode 100644
index 0000000000..d152181f8a
--- /dev/null
+++ b/tools/squashfs4/patches/002-Mksquashfs-Make-sysinfo-conditional.patch
@@ -0,0 +1,30 @@
+From 374e39a786a5acda841056bec26fd0e0c4d40dac Mon Sep 17 00:00:00 2001
+From: Phillip Lougher <phillip@squashfs.org.uk>
+Date: Mon, 15 Aug 2022 17:09:05 +0100
+Subject: [PATCH 1/1] Mksquashfs: Make sysinfo() conditional
+
+Fixes https://github.com/plougher/squashfs-tools/issues/123
+
+Signed-off-by: Phillip Lougher <phillip@squashfs.org.uk>
+---
+ squashfs-tools/mksquashfs.c | 2 ++
+ 1 file changed, 2 insertions(+)
+
+--- a/squashfs-tools/mksquashfs.c
++++ b/squashfs-tools/mksquashfs.c
+@@ -5802,6 +5802,7 @@ static int get_physical_memory()
+ long long page_size = sysconf(_SC_PAGESIZE);
+ int phys_mem;
+
++#ifdef __linux__
+ if(num_pages == -1 || page_size == -1) {
+ struct sysinfo sys;
+ int res = sysinfo(&sys);
+@@ -5812,6 +5813,7 @@ static int get_physical_memory()
+ num_pages = sys.totalram;
+ page_size = sys.mem_unit;
+ }
++#endif
+
+ phys_mem = num_pages * page_size >> 20;
+