@@ -28,10 +28,10 @@ index 4b06ccb..26365e7 100644
2828
2929 /*
3030diff --git a/squashfs-tools/info.c b/squashfs-tools/info.c
31−index 7968c77..c8e4c52 100644
31+index fe23d78..8efefe6 100644
3232--- a/squashfs-tools/info.c
3333+++ b/squashfs-tools/info.c
34−@@ -134,31 +134,22 @@ void dump_state()
34+@@ -144,31 +144,22 @@ void dump_state()
3535 void *info_thrd(void *arg)
3636 {
3737 sigset_t sigmask;
@@ -68,7 +68,7 @@ index 7968c77..c8e4c52 100644
6868 "because %s\n", strerror(errno));
6969 }
7070 }
71−@@ -169,8 +160,12 @@ void *info_thrd(void *arg)
71+@@ -179,8 +170,12 @@ void *info_thrd(void *arg)
7272 /* set one second interval period, if ^\ received
7373 within then, dump queue and cache status */
7474 waiting = 1;
@@ -83,12 +83,12 @@ index 7968c77..c8e4c52 100644
8383 }
8484
8585diff --git a/squashfs-tools/mksquashfs.c b/squashfs-tools/mksquashfs.c
86−index d696a51..c86d1b3 100644
86+index a45b77f..6d186ea 100644
8787--- a/squashfs-tools/mksquashfs.c
8888+++ b/squashfs-tools/mksquashfs.c
89−@@ -50,6 +50,10 @@
90− #include <limits.h>
89+@@ -52,6 +52,10 @@
9190 #include <ctype.h>
91+ #include <sys/sysinfo.h>
9292
9393+#ifndef FNM_EXTMATCH /* glibc extension */
9494+ #define FNM_EXTMATCH 0
@@ -97,101 +97,15 @@ index d696a51..c86d1b3 100644
9797 #ifndef linux
9898 #define __BYTE_ORDER BYTE_ORDER
9999 #define __BIG_ENDIAN BIG_ENDIAN
100−@@ -831,13 +835,13 @@ char *subpathname(struct dir_ent *dir_ent)
101− }
102−
103−
104−-inline unsigned int get_inode_no(struct inode_info *inode)
105−+static inline unsigned int get_inode_no(struct inode_info *inode)
106− {
107− return inode->inode_number;
108− }
109−
110−
111−-inline unsigned int get_parent_no(struct dir_info *dir)
112−+static inline unsigned int get_parent_no(struct dir_info *dir)
113− {
114− return dir->depth ? get_inode_no(dir->dir_ent->inode) : inode_no;
115− }
116−@@ -2030,7 +2034,7 @@ struct file_info *duplicate(long long file_size, long long bytes,
117− }
118−
119−
120−-inline int is_fragment(struct inode_info *inode)
121−+static inline int is_fragment(struct inode_info *inode)
122− {
123− off_t file_size = inode->buf.st_size;
124−
125−@@ -2999,13 +3003,13 @@ struct inode_info *lookup_inode2(struct stat *buf, int pseudo, int id)
126− }
127−
128−
129−-inline struct inode_info *lookup_inode(struct stat *buf)
130−+static inline struct inode_info *lookup_inode(struct stat *buf)
131− {
132− return lookup_inode2(buf, 0, 0);
133− }
134−
135−
136−-inline void alloc_inode_no(struct inode_info *inode, unsigned int use_this)
137−+static inline void alloc_inode_no(struct inode_info *inode, unsigned int use_this)
138− {
139− if (inode->inode_number == 0) {
140− inode->inode_number = use_this ? : inode_no ++;
141−@@ -3016,7 +3020,7 @@ inline void alloc_inode_no(struct inode_info *inode, unsigned int use_this)
142− }
143−
144−
145−-inline struct dir_ent *create_dir_entry(char *name, char *source_name,
146−+static inline struct dir_ent *create_dir_entry(char *name, char *source_name,
147− char *nonstandard_pathname, struct dir_info *dir)
148− {
149− struct dir_ent *dir_ent = malloc(sizeof(struct dir_ent));
150−@@ -3034,7 +3038,7 @@ inline struct dir_ent *create_dir_entry(char *name, char *source_name,
151− }
152−
153−
154−-inline void add_dir_entry(struct dir_ent *dir_ent, struct dir_info *sub_dir,
155−+static inline void add_dir_entry(struct dir_ent *dir_ent, struct dir_info *sub_dir,
156− struct inode_info *inode_info)
157− {
158− struct dir_info *dir = dir_ent->our_dir;
159−@@ -3050,7 +3054,7 @@ inline void add_dir_entry(struct dir_ent *dir_ent, struct dir_info *sub_dir,
160− }
161−
162−
163−-inline void add_dir_entry2(char *name, char *source_name,
164−+static inline void add_dir_entry2(char *name, char *source_name,
165− char *nonstandard_pathname, struct dir_info *sub_dir,
166− struct inode_info *inode_info, struct dir_info *dir)
167− {
168−@@ -3062,7 +3066,7 @@ inline void add_dir_entry2(char *name, char *source_name,
169− }
170−
171−
172−-inline void free_dir_entry(struct dir_ent *dir_ent)
173−+static inline void free_dir_entry(struct dir_ent *dir_ent)
174− {
175− if(dir_ent->name)
176− free(dir_ent->name);
177−@@ -3083,7 +3087,7 @@ inline void free_dir_entry(struct dir_ent *dir_ent)
178− }
179−
180−
181−-inline void add_excluded(struct dir_info *dir)
182−+static inline void add_excluded(struct dir_info *dir)
183− {
184− dir->excluded ++;
185− }
186−@@ -4200,6 +4204,7 @@ void initialise_threads(int readq, int fragq, int bwriteq, int fwriteq,
100+@@ -4348,6 +4352,7 @@ void initialise_threads(int readq, int fragq, int bwriteq, int fwriteq,
187101 sigemptyset(&sigmask);
188102 sigaddset(&sigmask, SIGQUIT);
189103 sigaddset(&sigmask, SIGHUP);
190104+ sigaddset(&sigmask, SIGALRM);
191− if(pthread_sigmask(SIG_BLOCK, &sigmask, NULL) == -1)
105+ if(pthread_sigmask(SIG_BLOCK, &sigmask, NULL) != 0)
192106 BAD_ERROR("Failed to set signal mask in intialise_threads\n");
193107
194−@@ -4987,6 +4992,36 @@ int parse_num(char *arg, int *res)
108+@@ -5184,6 +5189,36 @@ int parse_mode(char *arg, mode_t *res)
195109
196110 int get_physical_memory()
197111 {
@@ -228,21 +142,24 @@ index d696a51..c86d1b3 100644
228142 /*
229143 * Long longs are used here because with PAE, a 32-bit
230144 * machine can have more than 4GB of physical memory
231−@@ -4996,10 +5031,11 @@ int get_physical_memory()
145+@@ -5193,7 +5228,6 @@ int get_physical_memory()
232146 */
233147 long long num_pages = sysconf(_SC_PHYS_PAGES);
234148 long long page_size = sysconf(_SC_PAGESIZE);
235−- int phys_mem = num_pages * page_size >> 20;
236−+ phys_mem = num_pages * page_size >> 20;
149+- int phys_mem;
150+
151+ if(num_pages == -1 || page_size == -1) {
152+ struct sysinfo sys;
153+@@ -5207,6 +5241,7 @@ int get_physical_memory()
154+ }
237155
238− if(num_pages == -1 || page_size == -1)
239− return 0;
156+ phys_mem = num_pages * page_size >> 20;
240157+#endif
241158
242159 if(phys_mem < SQUASHFS_LOWMEM)
243160 BAD_ERROR("Mksquashfs requires more physical memory than is "
244161diff --git a/squashfs-tools/mksquashfs.h b/squashfs-tools/mksquashfs.h
245−index 55708a3..d44d1fd 100644
162+index 1beefef..88d0b5c 100644
246163--- a/squashfs-tools/mksquashfs.h
247164+++ b/squashfs-tools/mksquashfs.h
248165@@ -24,6 +24,7 @@
@@ -254,7 +171,7 @@ index 55708a3..d44d1fd 100644
254171 struct dir_info {
255172 char *pathname;
256173diff --git a/squashfs-tools/pseudo.c b/squashfs-tools/pseudo.c
257−index cb74cf6..fe2b4bc 100644
174+index 48e6b27..f8fd529 100644
258175--- a/squashfs-tools/pseudo.c
259176+++ b/squashfs-tools/pseudo.c
260177@@ -30,6 +30,7 @@
@@ -266,7 +183,7 @@ index cb74cf6..fe2b4bc 100644
266183 #include <sys/wait.h>
267184 #include <sys/stat.h>
268185diff --git a/squashfs-tools/read_xattrs.c b/squashfs-tools/read_xattrs.c
269−index 42106f5..837d3fb 100644
186+index 4debedf..3257c30 100644
270187--- a/squashfs-tools/read_xattrs.c
271188+++ b/squashfs-tools/read_xattrs.c
272189@@ -39,13 +39,13 @@
@@ -286,10 +203,10 @@ index 42106f5..837d3fb 100644
286203 extern int read_block(int, long long, long long *, int, void *);
287204
288205diff --git a/squashfs-tools/unsquashfs.c b/squashfs-tools/unsquashfs.c
289−index f190e96..927e441 100644
206+index 727f1d5..00615ce 100644
290207--- a/squashfs-tools/unsquashfs.c
291208+++ b/squashfs-tools/unsquashfs.c
292−@@ -32,7 +32,12 @@
209+@@ -32,8 +32,13 @@
293210 #include "stdarg.h"
294211 #include "fnmatch_compat.h"
295212
@@ -297,21 +214,22 @@ index f190e96..927e441 100644
297214+#include <sys/sysctl.h>
298215+#else
299216 #include <sys/sysinfo.h>
217+ #include <sys/sysmacros.h>
300218+#endif
301219+
302220 #include <sys/types.h>
303221 #include <sys/time.h>
304222 #include <sys/resource.h>
305−@@ -2185,6 +2190,7 @@ void initialise_threads(int fragment_buffer_size, int data_buffer_size)
223+@@ -2235,6 +2240,7 @@ void initialise_threads(int fragment_buffer_size, int data_buffer_size)
306224 sigemptyset(&sigmask);
307225 sigaddset(&sigmask, SIGQUIT);
308226 sigaddset(&sigmask, SIGHUP);
309227+ sigaddset(&sigmask, SIGALRM);
310− if(pthread_sigmask(SIG_BLOCK, &sigmask, NULL) == -1)
228+ if(pthread_sigmask(SIG_BLOCK, &sigmask, NULL) != 0)
311229 EXIT_UNSQUASH("Failed to set signal mask in initialise_threads"
312230 "\n");
313231diff --git a/squashfs-tools/unsquashfs.h b/squashfs-tools/unsquashfs.h
314−index 0edbd25..cea9caa 100644
232+index 934618b..329eb9e 100644
315233--- a/squashfs-tools/unsquashfs.h
316234+++ b/squashfs-tools/unsquashfs.h
317235@@ -46,6 +46,10 @@
@@ -381,7 +299,7 @@ index c8e2b9b..7d4f7af 100644
381299 }
382300
383301diff --git a/squashfs-tools/unsquashfs_xattr.c b/squashfs-tools/unsquashfs_xattr.c
384−index 59f4aae..13f0e35 100644
302+index 7742dfe..26ccd39 100644
385303--- a/squashfs-tools/unsquashfs_xattr.c
386304+++ b/squashfs-tools/unsquashfs_xattr.c
387305@@ -27,6 +27,11 @@
@@ -397,7 +315,7 @@ index 59f4aae..13f0e35 100644
397315
398316 extern int root_process;
399317diff --git a/squashfs-tools/xattr.c b/squashfs-tools/xattr.c
400−index b46550c..5b32eca 100644
318+index 64dfd82..9c4532d 100644
401319--- a/squashfs-tools/xattr.c
402320+++ b/squashfs-tools/xattr.c
403321@@ -22,6 +22,14 @@
@@ -429,3 +347,6 @@ index b46550c..5b32eca 100644
429347 #include "squashfs_fs.h"
430348 #include "squashfs_swap.h"
431349 #include "mksquashfs.h"
350+--
351+2.23.0
352+