blob: 27c9ae96242c836d85003a6e5a1c978bc25f80ca [file] [log] [blame]
Brad Bishop6e60e8b2018-02-01 10:27:11 -05001From 2153109e60e362e0d09215d529bf00176f31a3e7 Mon Sep 17 00:00:00 2001
2From: Khem Raj <raj.khem@gmail.com>
3Date: Fri, 31 Mar 2017 16:09:41 -0700
4Subject: [PATCH 4/5] Define missing features to cater for musl
5
6Signed-off-by: Khem Raj <raj.khem@gmail.com>
7---
8 src/systemd/sd-adapt/nm-sd-adapt.h | 2 +-
9 src/systemd/src/basic/parse-util.c | 5 ++++-
10 src/systemd/src/basic/stdio-util.h | 2 ++
11 src/systemd/src/basic/util.h | 5 +++++
12 src/systemd/src/systemd/sd-event.h | 4 ----
13 5 files changed, 12 insertions(+), 6 deletions(-)
14
15diff --git a/src/systemd/sd-adapt/nm-sd-adapt.h b/src/systemd/sd-adapt/nm-sd-adapt.h
16index cf27c1a..72c1b89 100644
17--- a/src/systemd/sd-adapt/nm-sd-adapt.h
18+++ b/src/systemd/sd-adapt/nm-sd-adapt.h
19@@ -119,7 +119,7 @@ G_STMT_START { \
20 # ifdef HAVE___SECURE_GETENV
21 # define secure_getenv __secure_getenv
22 # else
23-# error neither secure_getenv nor __secure_getenv is available
24+# define secure_getenv getenv
25 # endif
26 #endif
27
28diff --git a/src/systemd/src/basic/parse-util.c b/src/systemd/src/basic/parse-util.c
29index 2738663..9c21e5a 100644
30--- a/src/systemd/src/basic/parse-util.c
31+++ b/src/systemd/src/basic/parse-util.c
32@@ -25,8 +25,11 @@
33 #include <stdio.h>
34 #include <stdlib.h>
35 #include <string.h>
36+#ifdef __GLIBC__
37 #include <xlocale.h>
38-
39+#else
40+#include <locale.h>
41+#endif
42 #include "alloc-util.h"
43 #include "extract-word.h"
44 #include "macro.h"
45diff --git a/src/systemd/src/basic/stdio-util.h b/src/systemd/src/basic/stdio-util.h
46index bd1144b..c92e935 100644
47--- a/src/systemd/src/basic/stdio-util.h
48+++ b/src/systemd/src/basic/stdio-util.h
49@@ -19,7 +19,9 @@
50 along with systemd; If not, see <http://www.gnu.org/licenses/>.
51 ***/
52
53+#ifdef __GLIBC__
54 #include <printf.h>
55+#endif
56 #include <stdarg.h>
57 #include <stdio.h>
58 #include <sys/types.h>
59diff --git a/src/systemd/src/basic/util.h b/src/systemd/src/basic/util.h
60index bb2fc31..fe074a5 100644
61--- a/src/systemd/src/basic/util.h
62+++ b/src/systemd/src/basic/util.h
63@@ -46,6 +46,11 @@
64 #include "missing.h"
65 #include "time-util.h"
66
67+#if !defined(__GLIBC__)
68+typedef int (*__compar_fn_t) (const void*, const void*);
69+typedef __compar_fn_t comparison_fn_t;
70+#endif
71+
72 size_t page_size(void) _pure_;
73 #define PAGE_ALIGN(l) ALIGN_TO((l), page_size())
74
75diff --git a/src/systemd/src/systemd/sd-event.h b/src/systemd/src/systemd/sd-event.h
76index cc26b7d..c7e0004 100644
77--- a/src/systemd/src/systemd/sd-event.h
78+++ b/src/systemd/src/systemd/sd-event.h
79@@ -69,11 +69,7 @@ typedef int (*sd_event_handler_t)(sd_event_source *s, void *userdata);
80 typedef int (*sd_event_io_handler_t)(sd_event_source *s, int fd, uint32_t revents, void *userdata);
81 typedef int (*sd_event_time_handler_t)(sd_event_source *s, uint64_t usec, void *userdata);
82 typedef int (*sd_event_signal_handler_t)(sd_event_source *s, const struct signalfd_siginfo *si, void *userdata);
83-#if defined __USE_POSIX199309 || defined __USE_XOPEN_EXTENDED
84 typedef int (*sd_event_child_handler_t)(sd_event_source *s, const siginfo_t *si, void *userdata);
85-#else
86-typedef void* sd_event_child_handler_t;
87-#endif
88
89 int sd_event_default(sd_event **e);
90
91--
922.12.1
93