~xdavidwu/systemd-apkbuilds

ref: 41b96cafd0e6d4a12252bbbb6564230ecc968f30 systemd-apkbuilds/systemd/0023-shared-Do-not-use-malloc_info-on-musl.patch -rw-r--r-- 1.7 KiB
41b96cafPinghao Wu systemd: 256.2 8 months ago
                                                                                
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
From d3880d167d8dfafbb8ee62f7737a869f9525f303 Mon Sep 17 00:00:00 2001
From: Khem Raj <raj.khem@gmail.com>
Date: Wed, 2 Aug 2023 12:20:40 -0700
Subject: [PATCH 23/27] shared: Do not use malloc_info on musl

Upstream-Status: Inappropriate [musl-specific]
Signed-off-by: Khem Raj <raj.khem@gmail.com>
---
 src/shared/bus-util.c      | 5 +++--
 src/shared/common-signal.c | 4 ++--
 2 files changed, 5 insertions(+), 4 deletions(-)

diff --git a/src/shared/bus-util.c b/src/shared/bus-util.c
index 30f9602b1e..5308f168db 100644
--- a/src/shared/bus-util.c
+++ b/src/shared/bus-util.c
@@ -755,15 +755,16 @@ static int method_dump_memory_state_by_fd(sd_bus_message *message, void *userdat
         _cleanup_close_ int fd = -EBADF;
         size_t dump_size;
         FILE *f;
-        int r;
+        int r = 0;
 
         assert(message);
 
         f = memstream_init(&m);
         if (!f)
                 return -ENOMEM;
-
+#ifdef __GLIBC__
         r = RET_NERRNO(malloc_info(/* options= */ 0, f));
+#endif
         if (r < 0)
                 return r;
 
diff --git a/src/shared/common-signal.c b/src/shared/common-signal.c
index 8e70e365dd..9e782caec9 100644
--- a/src/shared/common-signal.c
+++ b/src/shared/common-signal.c
@@ -65,12 +65,12 @@ int sigrtmin18_handler(sd_event_source *s, const struct signalfd_siginfo *si, vo
                         log_oom();
                         break;
                 }
-
+#ifdef __GLIBC__
                 if (malloc_info(0, f) < 0) {
                         log_error_errno(errno, "Failed to invoke malloc_info(): %m");
                         break;
                 }
-
+#endif
                 (void) memstream_dump(LOG_INFO, &m);
                 break;
         }
-- 
2.45.1