From: Sam James Subject: [PATCH] Fix build on musl Closes: https://bugs.gentoo.org/715876 --- a/miscfuncs.c +++ b/miscfuncs.c @@ -8,6 +8,8 @@ #include #include #include +#include + #ifdef HAVE_UNISTD_H # include #endif @@ -65,7 +67,11 @@ int scan_directory(const char *dirname) char *basename; struct stat sbuf; DIR *dirp; - static char pathname[MAXNAMLEN]; + #ifdef NAME_MAX + static char pathname[NAME_MAX]; + #else + static char pathname[MAXNAMLEN] + #endif Dprintf(stderr, ">>> scanning directory '%s'\n", dirname); if ((dirp = opendir(dirname)) == NULL)