blob: 57e18a58087736794f2a3f8ee8843981a8112b4f [file] [log] [blame]
Andrew Geissler595f6302022-01-24 19:11:47 +00001From 7ca9887f84adba065dc2e59b3de55ace2fc72ec0 Mon Sep 17 00:00:00 2001
2From: Chen Qi <Qi.Chen@windriver.com>
3Date: Mon, 25 Feb 2019 15:00:06 +0800
4Subject: [PATCH] add missing FTW_ macros for musl
5
6This is to avoid build failures like below for musl.
7
8 locale-util.c:296:24: error: 'FTW_STOP' undeclared
9
10Upstream-Status: Inappropriate [musl specific]
11
12Signed-off-by: Chen Qi <Qi.Chen@windriver.com>
13
14---
15 src/basic/missing_type.h | 20 ++++++++++++++++++++
16 src/shared/mount-setup.c | 1 +
17 2 files changed, 21 insertions(+)
18
19--- a/src/basic/missing_type.h
20+++ b/src/basic/missing_type.h
21@@ -19,3 +19,23 @@ typedef int (*comparison_fn_t)(const voi
22 #define __COMPAR_FN_T
23 typedef int (*__compar_fn_t)(const void *, const void *);
24 #endif
25+
26+#ifndef FTW_ACTIONRETVAL
27+#define FTW_ACTIONRETVAL 16
28+#endif
29+
30+#ifndef FTW_CONTINUE
31+#define FTW_CONTINUE 0
32+#endif
33+
34+#ifndef FTW_STOP
35+#define FTW_STOP 1
36+#endif
37+
38+#ifndef FTW_SKIP_SUBTREE
39+#define FTW_SKIP_SUBTREE 2
40+#endif
41+
42+#ifndef FTW_SKIP_SIBLINGS
43+#define FTW_SKIP_SIBLINGS 3
44+#endif
45--- a/src/shared/mount-setup.c
46+++ b/src/shared/mount-setup.c
47@@ -32,6 +32,7 @@
48 #include "strv.h"
49 #include "user-util.h"
50 #include "virt.h"
51+#include "missing_type.h"
52
53 typedef enum MountMode {
54 MNT_NONE = 0,
55--- a/src/test/test-recurse-dir.c
56+++ b/src/test/test-recurse-dir.c
57@@ -6,6 +6,7 @@
58 #include "recurse-dir.h"
59 #include "strv.h"
60 #include "tests.h"
61+#include "missing_type.h"
62
63 static char **list_nftw = NULL;
64