1
0
mirror of git://sourceware.org/git/lvm2.git synced 2024-12-21 13:34:40 +03:00

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>
This commit is contained in:
Zdenek Kabelac 2024-03-27 00:28:14 +01:00
parent 8c4b8c6e27
commit f98d2ffe87

View File

@ -740,7 +740,7 @@ static int _dev_read_sys_serial(struct cmd_context *cmd, struct device *dev,
int ret; int ret;
/* /dev/vda to vda */ /* /dev/vda to vda */
base = basename(devname); base = dm_basename(devname);
/* vda1 to vda */ /* vda1 to vda */
for (i = 0; i < strlen(base); i++) { for (i = 0; i < strlen(base); i++) {