1
0

patch-squashfs-tools_unsquashfs_c 942 B

123456789101112131415161718192021222324252627282930313233343536373839
  1. --- squashfs4.2.orig/squashfs-tools/unsquashfs.c 2011-02-28 23:27:06.000000000 +0100
  2. +++ squashfs4.2/squashfs-tools/unsquashfs.c 2014-03-29 15:02:16.000000000 +0100
  3. @@ -29,7 +29,13 @@
  4. #include "compressor.h"
  5. #include "xattr.h"
  6. +#ifndef FNM_EXTMATCH
  7. +#define FNM_EXTMATCH 0
  8. +#endif
  9. +
  10. +#ifdef __linux__
  11. #include <sys/sysinfo.h>
  12. +#endif
  13. #include <sys/types.h>
  14. struct cache *fragment_cache, *data_cache;
  15. @@ -1810,7 +1816,7 @@ void initialise_threads(int fragment_buf
  16. "\n");
  17. if(processors == -1) {
  18. -#ifndef linux
  19. +#if 0
  20. int mib[2];
  21. size_t len = sizeof(processors);
  22. @@ -1821,11 +1827,13 @@ void initialise_threads(int fragment_buf
  23. mib[1] = HW_NCPU;
  24. #endif
  25. +#ifdef __linux__
  26. if(sysctl(mib, 2, &processors, &len, NULL, 0) == -1) {
  27. ERROR("Failed to get number of available processors. "
  28. "Defaulting to 1\n");
  29. processors = 1;
  30. }
  31. +#endif
  32. #else
  33. processors = sysconf(_SC_NPROCESSORS_ONLN);
  34. #endif