darwin.patch 2.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788
  1. diff -Nur squashfs4.2.orig/squashfs-tools/mksquashfs.c squashfs4.2/squashfs-tools/mksquashfs.c
  2. --- squashfs4.2.orig/squashfs-tools/mksquashfs.c 2011-02-28 23:24:09.000000000 +0100
  3. +++ squashfs4.2/squashfs-tools/mksquashfs.c 2014-03-22 11:32:00.000000000 +0100
  4. @@ -60,6 +60,10 @@
  5. #include <sys/sysinfo.h>
  6. #endif
  7. +#ifndef FNM_EXTMATCH
  8. +#define FNM_EXTMATCH 0
  9. +#endif
  10. +
  11. #ifdef SQUASHFS_TRACE
  12. #define TRACE(s, args...) \
  13. do { \
  14. @@ -721,13 +725,13 @@
  15. + (((char *)A) - data_cache)))
  16. -inline void inc_progress_bar()
  17. +static inline void inc_progress_bar()
  18. {
  19. cur_uncompressed ++;
  20. }
  21. -inline void update_progress_bar()
  22. +static inline void update_progress_bar()
  23. {
  24. pthread_mutex_lock(&progress_mutex);
  25. pthread_cond_signal(&progress_wait);
  26. @@ -735,7 +739,7 @@
  27. }
  28. -inline void waitforthread(int i)
  29. +static inline void waitforthread(int i)
  30. {
  31. TRACE("Waiting for thread %d\n", i);
  32. while(thread[i] != 0)
  33. @@ -3340,7 +3344,7 @@
  34. }
  35. -inline void add_dir_entry(char *name, char *pathname, struct dir_info *sub_dir,
  36. +static inline void add_dir_entry(char *name, char *pathname, struct dir_info *sub_dir,
  37. struct inode_info *inode_info, struct dir_info *dir)
  38. {
  39. if((dir->count % DIR_ENTRIES) == 0) {
  40. diff -Nur squashfs4.2.orig/squashfs-tools/unsquashfs.c squashfs4.2/squashfs-tools/unsquashfs.c
  41. --- squashfs4.2.orig/squashfs-tools/unsquashfs.c 2011-02-28 23:27:06.000000000 +0100
  42. +++ squashfs4.2/squashfs-tools/unsquashfs.c 2014-03-22 11:36:27.000000000 +0100
  43. @@ -29,7 +29,13 @@
  44. #include "compressor.h"
  45. #include "xattr.h"
  46. +#ifndef FNM_EXTMATCH
  47. +#define FNM_EXTMATCH 0
  48. +#endif
  49. +
  50. +#ifdef __linux__
  51. #include <sys/sysinfo.h>
  52. +#endif
  53. #include <sys/types.h>
  54. struct cache *fragment_cache, *data_cache;
  55. @@ -1810,7 +1816,7 @@
  56. "\n");
  57. if(processors == -1) {
  58. -#ifndef linux
  59. +#if 0
  60. int mib[2];
  61. size_t len = sizeof(processors);
  62. @@ -1821,11 +1827,13 @@
  63. mib[1] = HW_NCPU;
  64. #endif
  65. +#ifdef __linux__
  66. if(sysctl(mib, 2, &processors, &len, NULL, 0) == -1) {
  67. ERROR("Failed to get number of available processors. "
  68. "Defaulting to 1\n");
  69. processors = 1;
  70. }
  71. +#endif
  72. #else
  73. processors = sysconf(_SC_NPROCESSORS_ONLN);
  74. #endif