diff options
Diffstat (limited to 'meta/recipes-core/systemd/systemd/0019-errno-util-Make-STRERROR-portable-for-musl.patch')
-rw-r--r-- | meta/recipes-core/systemd/systemd/0019-errno-util-Make-STRERROR-portable-for-musl.patch | 42 |
1 files changed, 0 insertions, 42 deletions
diff --git a/meta/recipes-core/systemd/systemd/0019-errno-util-Make-STRERROR-portable-for-musl.patch b/meta/recipes-core/systemd/systemd/0019-errno-util-Make-STRERROR-portable-for-musl.patch deleted file mode 100644 index e038b73678..0000000000 --- a/meta/recipes-core/systemd/systemd/0019-errno-util-Make-STRERROR-portable-for-musl.patch +++ /dev/null | |||
@@ -1,42 +0,0 @@ | |||
1 | From 46d80840bfe37e67d4f18c37a77751ea1fe63a07 Mon Sep 17 00:00:00 2001 | ||
2 | From: Khem Raj <raj.khem@gmail.com> | ||
3 | Date: Mon, 23 Jan 2023 23:39:46 -0800 | ||
4 | Subject: [PATCH 19/22] errno-util: Make STRERROR portable for musl | ||
5 | |||
6 | Sadly, systemd has decided to use yet another GNU extention in a macro | ||
7 | lets make this such that we can use XSI compliant strerror_r() for | ||
8 | non-glibc hosts | ||
9 | |||
10 | Upstream-Status: Inappropriate [musl specific] | ||
11 | |||
12 | Signed-off-by: Khem Raj <raj.khem@gmail.com> | ||
13 | --- | ||
14 | src/basic/errno-util.h | 12 ++++++++++-- | ||
15 | 1 file changed, 10 insertions(+), 2 deletions(-) | ||
16 | |||
17 | diff --git a/src/basic/errno-util.h b/src/basic/errno-util.h | ||
18 | index 27804e6382..274c1c6ef1 100644 | ||
19 | --- a/src/basic/errno-util.h | ||
20 | +++ b/src/basic/errno-util.h | ||
21 | @@ -15,8 +15,16 @@ | ||
22 | * https://stackoverflow.com/questions/34880638/compound-literal-lifetime-and-if-blocks | ||
23 | * | ||
24 | * Note that we use the GNU variant of strerror_r() here. */ | ||
25 | -#define STRERROR(errnum) strerror_r(abs(errnum), (char[ERRNO_BUF_LEN]){}, ERRNO_BUF_LEN) | ||
26 | - | ||
27 | +static inline const char * STRERROR(int errnum); | ||
28 | + | ||
29 | +static inline const char * STRERROR(int errnum) { | ||
30 | +#ifdef __GLIBC__ | ||
31 | + return strerror_r(abs(errnum), (char[ERRNO_BUF_LEN]){}, ERRNO_BUF_LEN); | ||
32 | +#else | ||
33 | + static __thread char buf[ERRNO_BUF_LEN]; | ||
34 | + return strerror_r(abs(errnum), buf, ERRNO_BUF_LEN) ? "unknown error" : buf; | ||
35 | +#endif | ||
36 | +} | ||
37 | /* A helper to print an error message or message for functions that return 0 on EOF. | ||
38 | * Note that we can't use ({ … }) to define a temporary variable, so errnum is | ||
39 | * evaluated twice. */ | ||
40 | -- | ||
41 | 2.34.1 | ||
42 | |||