X-Git-Url: https://git.rohieb.name/openwrt.git/blobdiff_plain/85545a1d5a01821af290e54c7efbfc05d5a1d6f7..f4945cfe79ad6c9ac2bfef5c6505e45cae3a709b:/tools/squashfs4/patches/120-cygwin_fixes.patch?ds=inline diff --git a/tools/squashfs4/patches/120-cygwin_fixes.patch b/tools/squashfs4/patches/120-cygwin_fixes.patch index 1cc563e69..fa1dfba42 100644 --- a/tools/squashfs4/patches/120-cygwin_fixes.patch +++ b/tools/squashfs4/patches/120-cygwin_fixes.patch @@ -1,23 +1,7 @@ -diff -urN squashfs4.0/squashfs-tools/global.h squashfs4.0.new/squashfs-tools/global.h ---- squashfs4.0/squashfs-tools/global.h 2009-08-27 21:33:03.000000000 +0200 -+++ squashfs4.0.new/squashfs-tools/global.h 2009-08-27 21:36:38.000000000 +0200 -@@ -44,6 +44,11 @@ - typedef squashfs_inode_t squashfs_inode; - typedef squashfs_block_t squashfs_block; - -+#ifdef __CYGWIN__ -+#include -+#define FNM_EXTMATCH (1 << 5) -+#endif -+ - #ifndef FNM_EXTMATCH - #define FNM_EXTMATCH 0 - #endif -diff -urN squashfs4.0/squashfs-tools/mksquashfs.c squashfs4.0.new/squashfs-tools/mksquashfs.c ---- squashfs4.0/squashfs-tools/mksquashfs.c 2009-08-27 21:33:06.000000000 +0200 -+++ squashfs4.0.new/squashfs-tools/mksquashfs.c 2009-08-27 21:37:22.000000000 +0200 -@@ -49,10 +49,12 @@ - #include +--- a/squashfs-tools/mksquashfs.c ++++ b/squashfs-tools/mksquashfs.c +@@ -51,15 +51,22 @@ + #include #ifndef linux +#ifndef __CYGWIN__ @@ -29,7 +13,17 @@ diff -urN squashfs4.0/squashfs-tools/mksquashfs.c squashfs4.0.new/squashfs-tools #else #include #include -@@ -825,6 +827,7 @@ + #endif + ++#ifdef __CYGWIN__ ++#include ++#define FNM_EXTMATCH (1 << 5) ++#endif ++ + #ifndef FNM_EXTMATCH + #define FNM_EXTMATCH 0 + #endif +@@ -844,6 +851,7 @@ void sigusr1_handler() void sigwinch_handler() { @@ -37,7 +31,7 @@ diff -urN squashfs4.0/squashfs-tools/mksquashfs.c squashfs4.0.new/squashfs-tools struct winsize winsize; if(ioctl(1, TIOCGWINSZ, &winsize) == -1) { -@@ -834,6 +837,9 @@ +@@ -853,6 +861,9 @@ void sigwinch_handler() columns = 80; } else columns = winsize.ws_col; @@ -47,29 +41,27 @@ diff -urN squashfs4.0/squashfs-tools/mksquashfs.c squashfs4.0.new/squashfs-tools } -@@ -3753,7 +3759,9 @@ - BAD_ERROR("Failed to set signal mask in intialise_threads\n"); +@@ -4066,6 +4077,9 @@ void initialise_threads(int readb_mbytes signal(SIGUSR1, sigusr1_handler); -- + +#ifdef __CYGWIN__ + processors = atoi(getenv("NUMBER_OF_PROCESSORS")); +#else if(processors == -1) { #ifndef linux int mib[2]; -@@ -3775,6 +3783,7 @@ - processors = get_nprocs(); +@@ -4087,6 +4101,7 @@ void initialise_threads(int readb_mbytes + processors = sysconf(_SC_NPROCESSORS_ONLN); #endif } +#endif /* __CYGWIN__ */ - if((thread = malloc((2 + processors * 2) * sizeof(pthread_t))) == NULL) - BAD_ERROR("Out of memory allocating thread descriptors\n"); -diff -urN squashfs4.0/squashfs-tools/read_fs.c squashfs4.0.new/squashfs-tools/read_fs.c ---- squashfs4.0/squashfs-tools/read_fs.c 2009-08-27 21:33:06.000000000 +0200 -+++ squashfs4.0.new/squashfs-tools/read_fs.c 2009-08-27 21:41:54.000000000 +0200 -@@ -40,9 +40,11 @@ + thread = malloc((2 + processors * 2) * sizeof(pthread_t)); + if(thread == NULL) +--- a/squashfs-tools/read_fs.c ++++ b/squashfs-tools/read_fs.c +@@ -33,9 +33,11 @@ #include #ifndef linux @@ -81,9 +73,8 @@ diff -urN squashfs4.0/squashfs-tools/read_fs.c squashfs4.0.new/squashfs-tools/re #else #include #endif -diff -urN squashfs4.0/squashfs-tools/swap.c squashfs4.0.new/squashfs-tools/swap.c ---- squashfs4.0/squashfs-tools/swap.c 2009-03-26 05:40:16.000000000 +0100 -+++ squashfs4.0.new/squashfs-tools/swap.c 2009-08-27 21:44:52.000000000 +0200 +--- a/squashfs-tools/swap.c ++++ b/squashfs-tools/swap.c @@ -20,9 +20,11 @@ */ @@ -96,10 +87,9 @@ diff -urN squashfs4.0/squashfs-tools/swap.c squashfs4.0.new/squashfs-tools/swap. #else #include #endif -diff -urN squashfs4.0/squashfs-tools/unsquashfs.c squashfs4.0.new/squashfs-tools/unsquashfs.c ---- squashfs4.0/squashfs-tools/unsquashfs.c 2009-08-27 21:33:06.000000000 +0200 -+++ squashfs4.0.new/squashfs-tools/unsquashfs.c 2009-08-27 21:41:38.000000000 +0200 -@@ -111,6 +111,7 @@ +--- a/squashfs-tools/unsquashfs.c ++++ b/squashfs-tools/unsquashfs.c +@@ -117,6 +117,7 @@ void update_progress_bar(); void sigwinch_handler() { @@ -107,7 +97,7 @@ diff -urN squashfs4.0/squashfs-tools/unsquashfs.c squashfs4.0.new/squashfs-tools struct winsize winsize; if(ioctl(1, TIOCGWINSZ, &winsize) == -1) { -@@ -120,6 +121,9 @@ +@@ -126,6 +127,9 @@ void sigwinch_handler() columns = 80; } else columns = winsize.ws_col; @@ -117,7 +107,7 @@ diff -urN squashfs4.0/squashfs-tools/unsquashfs.c squashfs4.0.new/squashfs-tools } -@@ -1794,7 +1798,9 @@ +@@ -1807,7 +1811,9 @@ void initialise_threads(int fragment_buf if(sigprocmask(SIG_BLOCK, &sigmask, &old_mask) == -1) EXIT_UNSQUASH("Failed to set signal mask in intialise_threads" "\n"); @@ -128,18 +118,17 @@ diff -urN squashfs4.0/squashfs-tools/unsquashfs.c squashfs4.0.new/squashfs-tools if(processors == -1) { #ifndef linux int mib[2]; -@@ -1816,6 +1822,7 @@ - processors = get_nprocs(); +@@ -1829,6 +1835,7 @@ void initialise_threads(int fragment_buf + processors = sysconf(_SC_NPROCESSORS_ONLN); #endif } +#endif /* __CYGWIN__ */ - if((thread = malloc((3 + processors) * sizeof(pthread_t))) == NULL) - EXIT_UNSQUASH("Out of memory allocating thread descriptors\n"); -diff -urN squashfs4.0/squashfs-tools/unsquashfs.h squashfs4.0.new/squashfs-tools/unsquashfs.h ---- squashfs4.0/squashfs-tools/unsquashfs.h 2009-08-27 21:33:03.000000000 +0200 -+++ squashfs4.0.new/squashfs-tools/unsquashfs.h 2009-08-27 21:44:17.000000000 +0200 -@@ -46,10 +46,12 @@ + thread = malloc((3 + processors) * sizeof(pthread_t)); + if(thread == NULL) +--- a/squashfs-tools/unsquashfs.h ++++ b/squashfs-tools/unsquashfs.h +@@ -46,15 +46,22 @@ #include #ifndef linux @@ -148,7 +137,17 @@ diff -urN squashfs4.0/squashfs-tools/unsquashfs.h squashfs4.0.new/squashfs-tools #define __BIG_ENDIAN BIG_ENDIAN #define __LITTLE_ENDIAN LITTLE_ENDIAN #include -+#endif /* __CYGWIN__ */ ++#endif #else #include #include + #endif + ++#ifdef __CYGWIN__ ++#include ++#define FNM_EXTMATCH (1 << 5) ++#endif ++ + #ifndef FNM_EXTMATCH + #define FNM_EXTMATCH 0 + #endif