On recent Debian, we run into runtime errors in the test suite
because _POSIX_PATH_MAX is only 256, and that buffer is too small
for a call to realpath(). Use PATH_MAX if it's available and larger
than _POSIX_PATH_MAX, in a way that should be safe even when PATH_MAX
is not defined.
Change-Id: I39127e88d92b358245ece21131219380ca4be98a
Reviewed-on: http://gerrit.openafs.org/11453
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@your-file-system.com>
Reviewed-by: Chas Williams - CONTRACTOR <chas@cmf.nrl.navy.mil>
Reviewed-by: Perry Ruiter <pruiter@sinenomine.net>
Reviewed-by: D Brashear <shadow@your-file-system.com>
Tested-by: D Brashear <shadow@your-file-system.com>
#ifdef AFS_NT40_ENV
#define AFSDIR_PATH_MAX MAX_PATH
#else /* unices */
-#define AFSDIR_PATH_MAX _POSIX_PATH_MAX
+# ifndef PATH_MAX
+# define PATH_MAX 1024
+# endif
+# if PATH_MAX > _POSIX_PATH_MAX
+# define AFSDIR_PATH_MAX PATH_MAX
+# else
+# define AFSDIR_PATH_MAX _POSIX_PATH_MAX
+# endif
#endif