public inbox for linux-btrfs@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] btrfs-progs: device-utils: include libgen.h for musl
@ 2024-11-19  1:43 Dominique Martinet
  2024-11-19  4:31 ` Qu Wenruo
  2024-11-20 20:05 ` David Sterba
  0 siblings, 2 replies; 4+ messages in thread
From: Dominique Martinet @ 2024-11-19  1:43 UTC (permalink / raw)
  To: linux-btrfs, wqu; +Cc: Dominique Martinet

musl 1.2.5 no longer defines basename in strings.h and requires including
libgen.h as specified by POSIX, and builds now fail with this without it:
common/device-utils.c: In function 'device_get_partition_size_sysfs':
common/device-utils.c:345:16: warning: implicit declaration of function 'basename' [-Wimplicit-function-declaration]
  345 |         name = basename(path);
      |                ^~~~~~~~
common/device-utils.c:345:14: warning: assignment to 'char *' from 'int' makes pointer from integer without a cast [-Wint-conversion]
  345 |         name = basename(path);
      |              ^

Link: https://gitlab.alpinelinux.org/alpine/aports/-/issues/16106
Signed-off-by: Dominique Martinet <dominique.martinet@atmark-techno.com>
---

This was fixed in alpine for a while but the patch never seems to have
been sent (at least a quick search didn't turn it up)

It doesn't break anything for other libcs so probably harmless as is.

 common/device-utils.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/common/device-utils.c b/common/device-utils.c
index c39e6d6166ad..56924acd7901 100644
--- a/common/device-utils.c
+++ b/common/device-utils.c
@@ -22,6 +22,7 @@
 #include <linux/blkzoned.h>
 #endif
 #include <linux/fs.h>
+#include <libgen.h>
 #include <limits.h>
 #include <stdio.h>
 #include <stdlib.h>
--
2.39.5



^ permalink raw reply related	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2024-11-20 22:23 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-11-19  1:43 [PATCH] btrfs-progs: device-utils: include libgen.h for musl Dominique Martinet
2024-11-19  4:31 ` Qu Wenruo
2024-11-20 20:05 ` David Sterba
2024-11-20 22:23   ` Dominique Martinet

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox