$NetBSD: patch-ah,v 1.2 2012/12/12 12:47:50 wiz Exp $ --- fileio.c.orig 2011-09-05 18:26:37.000000000 +0000 +++ fileio.c @@ -14,6 +14,10 @@ #define DEFFILEMODE (S_IRUSR|S_IWUSR|S_IRGRP|S_IWGRP|S_IROTH|S_IWOTH) #endif +#ifndef NAME_MAX +#define NAME_MAX MAXNAMLEN +#endif + #include #include #include @@ -544,11 +548,7 @@ make_file_list(char *buf) * SV files are fairly short. For BSD, something more general would * be required. */ -#ifdef __CYGWIN__ /* Cygwin uses NAME_MAX for dirents */ if (preflen > NFILEN - NAME_MAX) -#else - if (preflen > NFILEN - MAXNAMLEN) -#endif return (NULL); /* loop over the specified directory, making up the list of files */