Commit 8dbd326
committed
build: fix musl build errors
libgen.h must be included to silence a compiler error regarding the
basename() function missing when building with musl libc.
The basename() function call in libnvme/src/nvme/linux.c:__nvme_transport_handle_open_direct()
causes a (fatal) compilation warning due to GNU using this declaration of basename:
char *basename (const char *filename)
and POSIX (and also musl) ommiting const. It is thus possible that the const char *devname
would be modified by basename().
The solution to the problem above is to use the internal implementation of basename from glibc
directly and avoid these API compatibility problems.
Signed-off-by: Michal Rábek <[email protected]>1 parent b048af7 commit 8dbd326
1 file changed
Lines changed: 9 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
12 | 12 | | |
13 | 13 | | |
14 | 14 | | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
15 | 19 | | |
16 | 20 | | |
17 | 21 | | |
| |||
83 | 87 | | |
84 | 88 | | |
85 | 89 | | |
86 | | - | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
87 | 95 | | |
88 | 96 | | |
89 | 97 | | |
| |||
0 commit comments