You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

120 lines
3.3 KiB

  1. From a0c129760ca9bdc7e564ae2a508fac3799f9d39b Mon Sep 17 00:00:00 2001
  2. From: Alexandru Ardelean <aa@ocedo.com>
  3. Date: Wed, 6 Jan 2016 15:33:43 +0200
  4. Subject: [PATCH 1/2] squashfs-tools: with fnmatch.h compatibility with musl
  5. Signed-off-by: Alexandru Ardelean <aa@ocedo.com>
  6. ---
  7. squashfs-tools/action.c | 2 +-
  8. squashfs-tools/fnmatch_compat.h | 32 ++++++++++++++++++++++++++++++++
  9. squashfs-tools/mksquashfs.c | 2 +-
  10. squashfs-tools/unsquashfs.c | 1 +
  11. squashfs-tools/unsquashfs.h | 1 -
  12. 5 files changed, 35 insertions(+), 3 deletions(-)
  13. create mode 100644 squashfs-tools/fnmatch_compat.h
  14. diff --git a/squashfs-tools/action.c b/squashfs-tools/action.c
  15. index 35889a4..4b06ccb 100644
  16. --- a/squashfs-tools/action.c
  17. +++ b/squashfs-tools/action.c
  18. @@ -31,7 +31,6 @@
  19. #include <sys/stat.h>
  20. #include <sys/types.h>
  21. #include <unistd.h>
  22. -#include <fnmatch.h>
  23. #include <pwd.h>
  24. #include <grp.h>
  25. #include <sys/wait.h>
  26. @@ -43,6 +42,7 @@
  27. #include "mksquashfs.h"
  28. #include "action.h"
  29. #include "error.h"
  30. +#include "fnmatch_compat.h"
  31. /*
  32. * code to parse actions
  33. diff --git a/squashfs-tools/fnmatch_compat.h b/squashfs-tools/fnmatch_compat.h
  34. new file mode 100644
  35. index 0000000..7b4afd8
  36. --- /dev/null
  37. +++ b/squashfs-tools/fnmatch_compat.h
  38. @@ -0,0 +1,32 @@
  39. +#ifndef FNMATCH_COMPAT
  40. +#define FNMATCH_COMPAT
  41. +/*
  42. + * Squashfs
  43. + *
  44. + * Copyright (c) 2015
  45. + * Phillip Lougher <phillip@squashfs.org.uk>
  46. + *
  47. + * This program is free software; you can redistribute it and/or
  48. + * modify it under the terms of the GNU General Public License
  49. + * as published by the Free Software Foundation; either version 2,
  50. + * or (at your option) any later version.
  51. + *
  52. + * This program is distributed in the hope that it will be useful,
  53. + * but WITHOUT ANY WARRANTY; without even the implied warranty of
  54. + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  55. + * GNU General Public License for more details.
  56. + *
  57. + * You should have received a copy of the GNU General Public License
  58. + * along with this program; if not, write to the Free Software
  59. + * Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
  60. + *
  61. + * fnmatch_compat.h
  62. + */
  63. +
  64. +#include <fnmatch.h>
  65. +
  66. +#ifndef FNM_EXTMATCH
  67. +#define FNM_EXTMATCH 0
  68. +#endif
  69. +
  70. +#endif
  71. diff --git a/squashfs-tools/mksquashfs.c b/squashfs-tools/mksquashfs.c
  72. index d221c35..4e7cbdd 100644
  73. --- a/squashfs-tools/mksquashfs.c
  74. +++ b/squashfs-tools/mksquashfs.c
  75. @@ -46,7 +46,6 @@
  76. #include <sys/mman.h>
  77. #include <pthread.h>
  78. #include <regex.h>
  79. -#include <fnmatch.h>
  80. #include <sys/wait.h>
  81. #include <limits.h>
  82. #include <ctype.h>
  83. @@ -76,6 +75,7 @@
  84. #include "read_fs.h"
  85. #include "restore.h"
  86. #include "process_fragments.h"
  87. +#include "fnmatch_compat.h"
  88. int delete = FALSE;
  89. int fd;
  90. diff --git a/squashfs-tools/unsquashfs.c b/squashfs-tools/unsquashfs.c
  91. index 1323dd6..2428baa 100644
  92. --- a/squashfs-tools/unsquashfs.c
  93. +++ b/squashfs-tools/unsquashfs.c
  94. @@ -30,6 +30,7 @@
  95. #include "xattr.h"
  96. #include "unsquashfs_info.h"
  97. #include "stdarg.h"
  98. +#include "fnmatch_compat.h"
  99. #include <sys/sysinfo.h>
  100. #include <sys/types.h>
  101. diff --git a/squashfs-tools/unsquashfs.h b/squashfs-tools/unsquashfs.h
  102. index ecd0bb4..0edbd25 100644
  103. --- a/squashfs-tools/unsquashfs.h
  104. +++ b/squashfs-tools/unsquashfs.h
  105. @@ -40,7 +40,6 @@
  106. #include <grp.h>
  107. #include <time.h>
  108. #include <regex.h>
  109. -#include <fnmatch.h>
  110. #include <signal.h>
  111. #include <pthread.h>
  112. #include <math.h>
  113. --
  114. 2.1.4