summaryrefslogtreecommitdiffstats
path: root/meta/recipes-core/systemd/systemd/0001-test-bus-error-strerror-is-assumed-to-be-GNU-specifi.patch
blob: c02d495d31367f7c119285a11081e5d11674d273 (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
From 5b5675913e2dbe6c5acda935b5814a8991829ec5 Mon Sep 17 00:00:00 2001
From: Khem Raj <raj.khem@gmail.com>
Date: Tue, 8 Nov 2022 13:31:34 -0800
Subject: [PATCH 2/2] test-bus-error: strerror() is assumed to be GNU specific version mark it so

Upstream-Status: Inappropriate [Upstream systemd only supports glibc]

Signed-off-by: Khem Raj <raj.khem@gmail.com>
---
 src/libsystemd/sd-bus/test-bus-error.c | 2 ++
 1 file changed, 2 insertions(+)

--- a/src/libsystemd/sd-bus/test-bus-error.c
+++ b/src/libsystemd/sd-bus/test-bus-error.c
@@ -99,7 +99,9 @@ TEST(error) {
         assert_se(!sd_bus_error_is_set(&error));
         assert_se(sd_bus_error_set_errno(&error, EBUSY) == -EBUSY);
         assert_se(streq(error.name, "System.Error.EBUSY"));
+#ifdef __GLIBC__
         assert_se(streq(error.message, STRERROR(EBUSY)));
+#endif
         assert_se(sd_bus_error_has_name(&error, "System.Error.EBUSY"));
         assert_se(sd_bus_error_get_errno(&error) == EBUSY);
         assert_se(sd_bus_error_is_set(&error));
--- a/src/test/test-errno-util.c
+++ b/src/test/test-errno-util.c
@@ -4,7 +4,7 @@
 #include "stdio-util.h"
 #include "string-util.h"
 #include "tests.h"
-
+#ifdef __GLIBC__
 TEST(strerror_not_threadsafe) {
         /* Just check that strerror really is not thread-safe. */
         log_info("strerror(%d) → %s", 200, strerror(200));
@@ -46,5 +46,6 @@ TEST(STRERROR_OR_ELSE) {
         log_info("STRERROR_OR_ELSE(EPERM, \"EOF\") → %s", STRERROR_OR_EOF(EPERM));
         log_info("STRERROR_OR_ELSE(-EPERM, \"EOF\") → %s", STRERROR_OR_EOF(-EPERM));
 }
+#endif /* __GLIBC__ */
 
 DEFINE_TEST_MAIN(LOG_INFO);