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