Share Pastebin
Guest
Public paste!

Patches for squashfs-tools4.0 for Cygwin

By: a guest | Sep 2nd, 2010 | Syntax: Diff | Size: 3.80 KB | Hits: 141 | Expires: Never
Copy text to clipboard
  1. diff -rupN squashfs4.0_org/squashfs-tools/global.h squashfs4.0/squashfs-tools/global.h
  2. --- squashfs4.0_org/squashfs-tools/global.h     2009-03-16 00:03:54.000000000 -0400
  3. +++ squashfs4.0/squashfs-tools/global.h 2010-09-02 14:46:26.732375000 -0400
  4. @@ -44,4 +44,9 @@ typedef long long squashfs_fragment_inde
  5.  typedef squashfs_inode_t squashfs_inode;
  6.  typedef squashfs_block_t squashfs_block;
  7.  
  8. +#ifdef __CYGWIN__
  9. +#include <sys/termios.h>
  10. +#define FNM_EXTMATCH (1 << 5)
  11. +#endif
  12. +
  13.  #endif
  14. diff -rupN squashfs4.0_org/squashfs-tools/mksquashfs.c squashfs4.0/squashfs-tools/mksquashfs.c
  15. --- squashfs4.0_org/squashfs-tools/mksquashfs.c 2009-04-05 17:22:48.000000000 -0400
  16. +++ squashfs4.0/squashfs-tools/mksquashfs.c     2010-09-02 14:57:08.435500000 -0400
  17. @@ -49,10 +49,14 @@
  18.  #include <fnmatch.h>
  19.  
  20.  #ifndef linux
  21. +#ifndef __CYGWIN__
  22.  #define __BYTE_ORDER BYTE_ORDER
  23.  #define __BIG_ENDIAN BIG_ENDIAN
  24.  #define __LITTLE_ENDIAN LITTLE_ENDIAN
  25. +#endif
  26. +#ifndef __CYGWIN__
  27.  #include <sys/sysctl.h>
  28. +#endif
  29.  #else
  30.  #include <endian.h>
  31.  #include <sys/sysinfo.h>
  32. @@ -3687,6 +3691,9 @@ void initialise_threads()
  33.  
  34.         signal(SIGUSR1, sigusr1_handler);
  35.  
  36. +#ifdef __CYGWIN__
  37. +  processors = atoi(getenv("NUMBER_OF_PROCESSORS"));
  38. +#else
  39.         if(processors == -1) {
  40.  #ifndef linux
  41.                 int mib[2];
  42. @@ -3708,6 +3715,7 @@ void initialise_threads()
  43.                 processors = get_nprocs();
  44.  #endif
  45.         }
  46. +#endif
  47.  
  48.         if((thread = malloc((2 + processors * 2) * sizeof(pthread_t))) == NULL)
  49.                 BAD_ERROR("Out of memory allocating thread descriptors\n");
  50. @@ -3962,7 +3970,6 @@ int excluded(struct pathnames *paths, ch
  51.                 return FALSE;
  52.         }
  53.  
  54. -
  55.         *new = init_subdir();
  56.         if(stickypath)
  57.                 *new = add_subdir(*new, stickypath);
  58. diff -rupN squashfs4.0_org/squashfs-tools/read_fs.c squashfs4.0/squashfs-tools/read_fs.c
  59. --- squashfs4.0_org/squashfs-tools/read_fs.c    2009-03-31 00:23:14.000000000 -0400
  60. +++ squashfs4.0/squashfs-tools/read_fs.c        2010-09-02 14:45:20.998000000 -0400
  61. @@ -40,9 +40,11 @@ extern unsigned int get_guid(unsigned in
  62.  #include <sys/mman.h>
  63.  
  64.  #ifndef linux
  65. +#ifndef __CYGWIN__
  66.  #define __BYTE_ORDER BYTE_ORDER
  67.  #define __BIG_ENDIAN BIG_ENDIAN
  68.  #define __LITTLE_ENDIAN LITTLE_ENDIAN
  69. +#endif
  70.  #else
  71.  #include <endian.h>
  72.  #endif
  73. diff -rupN squashfs4.0_org/squashfs-tools/unsquashfs.c squashfs4.0/squashfs-tools/unsquashfs.c
  74. --- squashfs4.0_org/squashfs-tools/unsquashfs.c 2009-04-05 17:23:06.000000000 -0400
  75. +++ squashfs4.0/squashfs-tools/unsquashfs.c     2010-09-02 14:44:58.013625000 -0400
  76. @@ -110,6 +110,7 @@ void update_progress_bar();
  77.  
  78.  void sigwinch_handler()
  79.  {
  80. +#ifndef __CYGWIN__
  81.         struct winsize winsize;
  82.  
  83.         if(ioctl(1, TIOCGWINSZ, &winsize) == -1) {
  84. @@ -119,6 +120,9 @@ void sigwinch_handler()
  85.                 columns = 80;
  86.         } else
  87.                 columns = winsize.ws_col;
  88. +#else
  89. +    columns = 80;
  90. +#endif
  91.  }
  92.  
  93.  
  94. @@ -1793,6 +1797,9 @@ void initialise_threads(int fragment_buf
  95.                 EXIT_UNSQUASH("Failed to set signal mask in intialise_threads"
  96.                         "\n");
  97.  
  98. +#ifdef __CYGWIN__
  99. +  processors = atoi(getenv("NUMBER_OF_PROCESSORS"));
  100. +#else
  101.         if(processors == -1) {
  102.  #ifndef linux
  103.                 int mib[2];
  104. @@ -1814,6 +1821,7 @@ void initialise_threads(int fragment_buf
  105.                 processors = get_nprocs();
  106.  #endif
  107.         }
  108. +#endif
  109.  
  110.         if((thread = malloc((3 + processors) * sizeof(pthread_t))) == NULL)
  111.                 EXIT_UNSQUASH("Out of memory allocating thread descriptors\n");
  112. diff -rupN squashfs4.0_org/squashfs-tools/unsquashfs.h squashfs4.0/squashfs-tools/unsquashfs.h
  113. --- squashfs4.0_org/squashfs-tools/unsquashfs.h 2009-03-28 22:29:02.000000000 -0400
  114. +++ squashfs4.0/squashfs-tools/unsquashfs.h     2010-09-02 14:42:21.154250000 -0400
  115. @@ -46,9 +46,11 @@
  116.  #include <sys/time.h>
  117.  
  118.  #ifndef linux
  119. +#ifndef __CYGWIN__
  120.  #define __BYTE_ORDER BYTE_ORDER
  121.  #define __BIG_ENDIAN BIG_ENDIAN
  122.  #define __LITTLE_ENDIAN LITTLE_ENDIAN
  123. +#endif
  124.  #else
  125.  #include <endian.h>
  126.  #endif