Omit unused PATH_MAX code

* 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.
This commit is contained in:
Paul Eggert 2024-08-05 01:04:13 -07:00 committed by Paul Smith
parent 8c8c7fc226
commit 4d3bf7838f
2 changed files with 2 additions and 28 deletions

View file

@ -149,15 +149,8 @@ extern int errno;
# endif # endif
#endif #endif
#ifdef PATH_MAX #define GET_PATH_MAX PATH_MAX
# define GET_PATH_MAX PATH_MAX #define PATH_VAR(var) char var[PATH_MAX+1]
# 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
#ifndef CHAR_BIT #ifndef CHAR_BIT
# define CHAR_BIT 8 # define CHAR_BIT 8

View file

@ -948,25 +948,6 @@ strncasecmp (const char *s1, const char *s2, size_t n)
#endif #endif
#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 #if !HAVE_MEMPCPY
void * void *
mempcpy (void *dest, const void *src, size_t n) mempcpy (void *dest, const void *src, size_t n)