aboutsummaryrefslogtreecommitdiff
path: root/sysutils/squashfs-tools/files/patch-mksquashfs.c
diff options
context:
space:
mode:
Diffstat (limited to 'sysutils/squashfs-tools/files/patch-mksquashfs.c')
-rw-r--r--sysutils/squashfs-tools/files/patch-mksquashfs.c34
1 files changed, 34 insertions, 0 deletions
diff --git a/sysutils/squashfs-tools/files/patch-mksquashfs.c b/sysutils/squashfs-tools/files/patch-mksquashfs.c
new file mode 100644
index 000000000000..d2357e73ab5c
--- /dev/null
+++ b/sysutils/squashfs-tools/files/patch-mksquashfs.c
@@ -0,0 +1,34 @@
+--- mksquashfs.c.orig 2019-08-29 01:58:04 UTC
++++ mksquashfs.c
+@@ -35,7 +35,6 @@
+ #include <stddef.h>
+ #include <sys/types.h>
+ #include <sys/stat.h>
+-#include <sys/sysmacros.h>
+ #include <fcntl.h>
+ #include <errno.h>
+ #include <dirent.h>
+@@ -50,7 +49,6 @@
+ #include <sys/wait.h>
+ #include <limits.h>
+ #include <ctype.h>
+-#include <sys/sysinfo.h>
+
+ #ifndef linux
+ #define __BYTE_ORDER BYTE_ORDER
+@@ -5195,6 +5193,7 @@ 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);
+@@ -5205,6 +5204,7 @@ int get_physical_memory()
+ num_pages = sys.totalram;
+ page_size = sys.mem_unit;
+ }
++#endif
+
+ phys_mem = num_pages * page_size >> 20;
+