--- a/mdadm.h +++ b/mdadm.h @@ -248,6 +248,14 @@ static inline void __put_unaligned32(__u } /* + * Ensure GNU basename behavior for musl libc + */ +#ifndef __GLIBC__ +#define basename(path) \ + (strrchr((path),'/') ? strrchr((path),'/')+1 : (path)) +#endif + +/* * Check at compile time that something is of a particular type. * Always evaluates to 1 so you may use it easily in comparisons. */