You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
gentoo-overlay/app-admin/xtail/files/xtail-2.1_p8-fix-limits-mus...

29 lines
688 B

From: Sam James <sam@gentoo.org>
Subject: [PATCH] Fix build on musl
Closes: https://bugs.gentoo.org/715876
--- a/miscfuncs.c
+++ b/miscfuncs.c
@@ -8,6 +8,8 @@
#include <ctype.h>
#include <fcntl.h>
#include <errno.h>
+#include <limits.h>
+
#ifdef HAVE_UNISTD_H
# include <unistd.h>
#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)