Commit c59a593
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 c59a593
3 files changed
Lines changed: 22 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 | + | |
87 | 91 | | |
88 | 92 | | |
89 | 93 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1179 | 1179 | | |
1180 | 1180 | | |
1181 | 1181 | | |
| 1182 | + | |
| 1183 | + | |
| 1184 | + | |
| 1185 | + | |
| 1186 | + | |
| 1187 | + | |
| 1188 | + | |
| 1189 | + | |
| 1190 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
785 | 785 | | |
786 | 786 | | |
787 | 787 | | |
| 788 | + | |
| 789 | + | |
| 790 | + | |
| 791 | + | |
| 792 | + | |
| 793 | + | |
| 794 | + | |
| 795 | + | |
788 | 796 | | |
0 commit comments