mdadm: Fix compile with musl 1.1.23
[openwrt/.git] / package / utils / mdadm / patches / 102-Add-missing-include-file-sys-sysmacros.h.patch
1 From 1ee119c8026dff34a4d8c4269c05d3d4e0c25aa6 Mon Sep 17 00:00:00 2001
2 From: Hauke Mehrtens <hauke@hauke-m.de>
3 Date: Sat, 3 Aug 2019 11:03:40 +0200
4 Subject: [mdadm PATCH] Add missing include file sys/sysmacros.h
5
6 This include file is needed for makedev(), major() and minor() which are
7 used in these functions. In musl 1.1.23 sys/sysmacros.h is not included
8 indirectly any more and mdadm fails to compile.
9
10 Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
11 ---
12  Assemble.c       | 1 +
13  Build.c          | 1 +
14  Create.c         | 1 +
15  Detail.c         | 1 +
16  Grow.c           | 1 +
17  Incremental.c    | 1 +
18  Manage.c         | 1 +
19  Monitor.c        | 1 +
20  Query.c          | 1 +
21  lib.c            | 1 +
22  mapfile.c        | 1 +
23  mdadm.c          | 1 +
24  mdopen.c         | 1 +
25  platform-intel.c | 1 +
26  policy.c         | 1 +
27  super-ddf.c      | 1 +
28  super-intel.c    | 1 +
29  sysfs.c          | 1 +
30  util.c           | 1 +
31  19 files changed, 19 insertions(+)
32
33 --- a/Assemble.c
34 +++ b/Assemble.c
35 @@ -24,6 +24,7 @@
36  
37  #include       "mdadm.h"
38  #include       <ctype.h>
39 +#include       <sys/sysmacros.h>
40  
41  static int name_matches(char *found, char *required, char *homehost, int require_homehost)
42  {
43 --- a/Build.c
44 +++ b/Build.c
45 @@ -23,6 +23,7 @@
46   */
47  
48  #include "mdadm.h"
49 +#include <sys/sysmacros.h>
50  
51  int Build(char *mddev, struct mddev_dev *devlist,
52           struct shape *s, struct context *c)
53 --- a/Create.c
54 +++ b/Create.c
55 @@ -26,6 +26,7 @@
56  #include       "md_u.h"
57  #include       "md_p.h"
58  #include       <ctype.h>
59 +#include       <sys/sysmacros.h>
60  
61  static int default_layout(struct supertype *st, int level, int verbose)
62  {
63 --- a/Detail.c
64 +++ b/Detail.c
65 @@ -27,6 +27,7 @@
66  #include       "md_u.h"
67  #include       <ctype.h>
68  #include       <dirent.h>
69 +#include       <sys/sysmacros.h>
70  
71  static int cmpstringp(const void *p1, const void *p2)
72  {
73 --- a/Grow.c
74 +++ b/Grow.c
75 @@ -27,6 +27,7 @@
76  #include       <stddef.h>
77  #include       <stdint.h>
78  #include       <signal.h>
79 +#include       <sys/sysmacros.h>
80  #include       <sys/wait.h>
81  
82  #if ! defined(__BIG_ENDIAN) && ! defined(__LITTLE_ENDIAN)
83 --- a/Incremental.c
84 +++ b/Incremental.c
85 @@ -29,6 +29,7 @@
86   */
87  
88  #include       "mdadm.h"
89 +#include       <sys/sysmacros.h>
90  #include       <sys/wait.h>
91  #include       <dirent.h>
92  #include       <ctype.h>
93 --- a/Manage.c
94 +++ b/Manage.c
95 @@ -26,6 +26,7 @@
96  #include "md_u.h"
97  #include "md_p.h"
98  #include <ctype.h>
99 +#include <sys/sysmacros.h>
100  
101  int Manage_ro(char *devname, int fd, int readonly)
102  {
103 --- a/Monitor.c
104 +++ b/Monitor.c
105 @@ -25,6 +25,7 @@
106  #include       "mdadm.h"
107  #include       "md_p.h"
108  #include       "md_u.h"
109 +#include       <sys/sysmacros.h>
110  #include       <sys/wait.h>
111  #include       <signal.h>
112  #include       <limits.h>
113 --- a/Query.c
114 +++ b/Query.c
115 @@ -25,6 +25,7 @@
116  #include       "mdadm.h"
117  #include       "md_p.h"
118  #include       "md_u.h"
119 +#include       <sys/sysmacros.h>
120  
121  int Query(char *dev)
122  {
123 --- a/lib.c
124 +++ b/lib.c
125 @@ -25,6 +25,7 @@
126  #include       "mdadm.h"
127  #include       "dlink.h"
128  #include       <ctype.h>
129 +#include       <sys/sysmacros.h>
130  
131  /* This fill contains various 'library' style function.  They
132   * have no dependency on anything outside this file.
133 --- a/mapfile.c
134 +++ b/mapfile.c
135 @@ -44,6 +44,7 @@
136   */
137  #include       "mdadm.h"
138  #include       <sys/file.h>
139 +#include       <sys/sysmacros.h>
140  #include       <ctype.h>
141  
142  #define MAP_READ 0
143 --- a/mdadm.c
144 +++ b/mdadm.c
145 @@ -28,6 +28,7 @@
146  #include "mdadm.h"
147  #include "md_p.h"
148  #include <ctype.h>
149 +#include <sys/sysmacros.h>
150  
151  static int scan_assemble(struct supertype *ss,
152                          struct context *c,
153 --- a/mdopen.c
154 +++ b/mdopen.c
155 @@ -25,6 +25,7 @@
156  #include "mdadm.h"
157  #include "md_p.h"
158  #include <ctype.h>
159 +#include <sys/sysmacros.h>
160  
161  void make_parts(char *dev, int cnt)
162  {
163 --- a/platform-intel.c
164 +++ b/platform-intel.c
165 @@ -28,6 +28,7 @@
166  #include <sys/mman.h>
167  #include <sys/types.h>
168  #include <sys/stat.h>
169 +#include <sys/sysmacros.h>
170  #include <limits.h>
171  
172  static int devpath_to_ll(const char *dev_path, const char *entry,
173 --- a/policy.c
174 +++ b/policy.c
175 @@ -26,6 +26,7 @@
176  #include <dirent.h>
177  #include <fnmatch.h>
178  #include <ctype.h>
179 +#include <sys/sysmacros.h>
180  #include "dlink.h"
181  /*
182   * Policy module for mdadm.
183 --- a/super-ddf.c
184 +++ b/super-ddf.c
185 @@ -31,6 +31,7 @@
186  #include "sha1.h"
187  #include <values.h>
188  #include <stddef.h>
189 +#include <sys/sysmacros.h>
190  
191  /* a non-official T10 name for creation GUIDs */
192  static char T10[] = "Linux-MD";
193 --- a/super-intel.c
194 +++ b/super-intel.c
195 @@ -24,6 +24,7 @@
196  #include "platform-intel.h"
197  #include <values.h>
198  #include <scsi/sg.h>
199 +#include <sys/sysmacros.h>
200  #include <ctype.h>
201  #include <dirent.h>
202  
203 --- a/sysfs.c
204 +++ b/sysfs.c
205 @@ -26,6 +26,7 @@
206  #include       "mdadm.h"
207  #include       <dirent.h>
208  #include       <ctype.h>
209 +#include       <sys/sysmacros.h>
210  
211  #define MAX_SYSFS_PATH_LEN     120
212  
213 --- a/util.c
214 +++ b/util.c
215 @@ -29,6 +29,7 @@
216  #include       <sys/wait.h>
217  #include       <sys/un.h>
218  #include       <sys/resource.h>
219 +#include       <sys/sysmacros.h>
220  #include       <sys/vfs.h>
221  #include       <sys/mman.h>
222  #include       <linux/magic.h>