]> git.ipfire.org Git - thirdparty/make.git/commitdiff
Omit unused PATH_MAX code
authorPaul Eggert <eggert@cs.ucla.edu>
Mon, 5 Aug 2024 08:04:13 +0000 (01:04 -0700)
committerPaul Smith <psmith@gnu.org>
Mon, 2 Sep 2024 18:43:24 +0000 (14:43 -0400)
* src/makeint.h (GET_PATH_MAX, PATH_VAR):
Simplify, since PATH_MAX is always defined here.
(NEED_GET_PATH_MAX): Remove.
* src/misc.c (get_path_max) [NEED_GET_PATH_MAX]: Remove.

src/makeint.h
src/misc.c

index 5a553093a9c97303f6f4376fe677026738e46944..61c7822926e0b09f660fd7acc5bb15272c58eb43 100644 (file)
@@ -149,15 +149,8 @@ extern int errno;
 # endif
 #endif
 
-#ifdef PATH_MAX
-# define GET_PATH_MAX   PATH_MAX
-# define PATH_VAR(var)  char var[PATH_MAX+1]
-#else
-# define NEED_GET_PATH_MAX 1
-# define GET_PATH_MAX   (get_path_max ())
-# define PATH_VAR(var)  char *var = alloca (GET_PATH_MAX+1)
-unsigned int get_path_max (void);
-#endif
+#define GET_PATH_MAX   PATH_MAX
+#define PATH_VAR(var)  char var[PATH_MAX+1]
 
 #ifndef CHAR_BIT
 # define CHAR_BIT 8
index 1914aa22dc68411fcad66ddea876bbd6e259116b..9e41a546307f3a6db960fa1801361bd9b4cfad93 100644 (file)
@@ -948,25 +948,6 @@ strncasecmp (const char *s1, const char *s2, size_t n)
 #endif
 \f
 
-#ifdef NEED_GET_PATH_MAX
-unsigned int
-get_path_max (void)
-{
-  static unsigned int value;
-
-  if (value == 0)
-    {
-      long x = pathconf ("/", _PC_PATH_MAX);
-      if (x > 0)
-        value = (unsigned int) x;
-      else
-        value = PATH_MAX;
-    }
-
-  return value;
-}
-#endif
-
 #if !HAVE_MEMPCPY
 void *
 mempcpy (void *dest, const void *src, size_t n)