$NetBSD: patch-ab,v 1.5 2020/11/25 14:59:24 ryoon Exp $ - Use NAME_MAX if available rather than relying on MAXNAMLEN. - Fix Solaris preprocessor symbols. - Fix bad calls to execlp() that break on 64-bit platforms. --- compfile.c.orig 2018-11-30 14:25:04.000000000 +0000 +++ compfile.c @@ -2,6 +2,7 @@ #include #include +#include #include #include @@ -224,7 +225,7 @@ void waitforgzip() * version; */ -#if ( defined(sun) && defined(__svr4__) ) || defined(__CYGWIN32__) +#if ( defined(__sun) && defined(__svr4__) ) || defined(__CYGWIN32__) #include #else #include @@ -299,7 +300,9 @@ compressfile (int *fdp, char *name, reg #ifdef NAME_MAX if (strlen (tmpcomp) + 2 > NAME_MAX) #else -#ifdef MAXNAMLEN /* BSD otherwise should be sysV (FFS on sysV?) */ +#if defined(NAME_MAX) + if (strlen (tmpcomp) + 2 > NAME_MAX) +#elif defined(MAXNAMLEN) /* BSD otherwise should be sysV (FFS on sysV?) */ if (strlen (tmpcomp) + 2 > MAXNAMLEN) #else if (strlen (tmpcomp) + 2 > DIRSIZ)