summaryrefslogtreecommitdiffstats
path: root/meta/recipes-core/systemd/systemd/0008-add-missing-FTW_-macros-for-musl.patch
blob: 57e18a58087736794f2a3f8ee8843981a8112b4f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
From 7ca9887f84adba065dc2e59b3de55ace2fc72ec0 Mon Sep 17 00:00:00 2001
From: Chen Qi <Qi.Chen@windriver.com>
Date: Mon, 25 Feb 2019 15:00:06 +0800
Subject: [PATCH] add missing FTW_ macros for musl

This is to avoid build failures like below for musl.

  locale-util.c:296:24: error: 'FTW_STOP' undeclared

Upstream-Status: Inappropriate [musl specific]

Signed-off-by: Chen Qi <Qi.Chen@windriver.com>

---
 src/basic/missing_type.h | 20 ++++++++++++++++++++
 src/shared/mount-setup.c |  1 +
 2 files changed, 21 insertions(+)

--- a/src/basic/missing_type.h
+++ b/src/basic/missing_type.h
@@ -19,3 +19,23 @@ typedef int (*comparison_fn_t)(const voi
 #define __COMPAR_FN_T
 typedef int (*__compar_fn_t)(const void *, const void *);
 #endif
+
+#ifndef FTW_ACTIONRETVAL
+#define FTW_ACTIONRETVAL 16
+#endif
+
+#ifndef FTW_CONTINUE
+#define FTW_CONTINUE 0
+#endif
+
+#ifndef FTW_STOP
+#define FTW_STOP 1
+#endif
+
+#ifndef FTW_SKIP_SUBTREE
+#define FTW_SKIP_SUBTREE 2
+#endif
+
+#ifndef FTW_SKIP_SIBLINGS
+#define FTW_SKIP_SIBLINGS 3
+#endif
--- a/src/shared/mount-setup.c
+++ b/src/shared/mount-setup.c
@@ -32,6 +32,7 @@
 #include "strv.h"
 #include "user-util.h"
 #include "virt.h"
+#include "missing_type.h"
 
 typedef enum MountMode {
         MNT_NONE           = 0,
--- a/src/test/test-recurse-dir.c
+++ b/src/test/test-recurse-dir.c
@@ -6,6 +6,7 @@
 #include "recurse-dir.h"
 #include "strv.h"
 #include "tests.h"
+#include "missing_type.h"
 
 static char **list_nftw = NULL;