squashfs4: fix a compile error on big-endian systems (patch from #9842)
[openwrt.git] / tools / squashfs4 / patches / 120-cygwin_fixes.patch
index 1cc563e..fa1dfba 100644 (file)
@@ -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 <sys/termios.h>
-+#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 <fnmatch.h>
+--- a/squashfs-tools/mksquashfs.c
++++ b/squashfs-tools/mksquashfs.c
+@@ -51,15 +51,22 @@
+ #include <sys/wait.h>
  
  #ifndef linux
 +#ifndef __CYGWIN__
@@ -29,7 +13,17 @@ diff -urN squashfs4.0/squashfs-tools/mksquashfs.c squashfs4.0.new/squashfs-tools
  #else
  #include <endian.h>
  #include <sys/sysinfo.h>
-@@ -825,6 +827,7 @@
+ #endif
++#ifdef __CYGWIN__
++#include <sys/termios.h>
++#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 <sys/mman.h>
  
  #ifndef linux
@@ -81,9 +73,8 @@ diff -urN squashfs4.0/squashfs-tools/read_fs.c squashfs4.0.new/squashfs-tools/re
  #else
  #include <endian.h>
  #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 <endian.h>
  #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 <sys/time.h>
  
  #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 <sys/sysctl.h>
-+#endif /* __CYGWIN__ */
++#endif
  #else
  #include <endian.h>
  #include <sys/sysinfo.h>
+ #endif
++#ifdef __CYGWIN__
++#include <sys/termios.h>
++#define FNM_EXTMATCH  (1 << 5)
++#endif
++
+ #ifndef FNM_EXTMATCH
+ #define FNM_EXTMATCH 0
+ #endif
This page took 0.029013 seconds and 4 git commands to generate.