From: Benjamin Kaduk Date: Mon, 8 Sep 2014 17:47:33 +0000 (-0400) Subject: Tweak AFSDIR_PATH_MAX definition X-Git-Tag: upstream/1.6.17^2~52 X-Git-Url: https://git.michaelhowe.org/gitweb/?a=commitdiff_plain;h=cb18459a5dae9559de506d7decf02a636847d0fa;p=packages%2Fo%2Fopenafs.git Tweak AFSDIR_PATH_MAX definition 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. Reviewed-on: http://gerrit.openafs.org/11453 Tested-by: BuildBot Reviewed-by: Jeffrey Altman Reviewed-by: Chas Williams - CONTRACTOR Reviewed-by: Perry Ruiter Reviewed-by: D Brashear Tested-by: D Brashear (cherry picked from commit ec2382e060753dfdcaf84b9ac03e1534c65fcdbc) Change-Id: I37222dcb019ed9593a499b84a3e4ab30b8a9cf9c Reviewed-on: http://gerrit.openafs.org/11588 Tested-by: BuildBot Reviewed-by: Daria Phoebe Brashear Reviewed-by: Jeffrey Altman Reviewed-by: Stephan Wiesand --- diff --git a/src/util/dirpath.hin b/src/util/dirpath.hin index 289042632..ae6d2cf58 100644 --- a/src/util/dirpath.hin +++ b/src/util/dirpath.hin @@ -75,7 +75,14 @@ #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