blob: 2dd9f8ff524c5190c19aab47696d52f44d84e1cf (
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
|
https://bugs.gentoo.org/937239
https://github.com/lvmteam/lvm2/commit/f98d2ffe8753895c84160a7abce4223bd127cd9e
From f98d2ffe8753895c84160a7abce4223bd127cd9e Mon Sep 17 00:00:00 2001
From: Zdenek Kabelac <zkabelac@redhat.com>
Date: Wed, 27 Mar 2024 00:28:14 +0100
Subject: [PATCH] device_id: use dm_basename
Avoid problems for other libc like muslc and use dm_basename.
Prototype for basename has been removed from string.h from latest musl [1]
compilers e.g. clang-18 flags the absense of prototype as error. therefore
include libgen.h for providing it.
[1] https://git.musl-libc.org/cgit/musl/commit/?id=725e17ed6dff4d0cd22487bb64470881e86a92e7
Reported-by: Khem Raj <raj.khem@gmail.com>
---
lib/device/device_id.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/lib/device/device_id.c b/lib/device/device_id.c
index 7d67a1cb7..200d39432 100644
--- a/lib/device/device_id.c
+++ b/lib/device/device_id.c
@@ -740,7 +740,7 @@ static int _dev_read_sys_serial(struct cmd_context *cmd, struct device *dev,
int ret;
/* /dev/vda to vda */
- base = basename(devname);
+ base = dm_basename(devname);
/* vda1 to vda */
for (i = 0; i < strlen(base); i++) {
|