]> Savannah Git Hosting - gnulib.git/commit
canonicalize-lgpl: simplify merge to glibc
authorPaul Eggert <eggert@cs.ucla.edu>
Mon, 14 Dec 2020 19:59:20 +0000 (11:59 -0800)
committerPaul Eggert <eggert@cs.ucla.edu>
Thu, 17 Dec 2020 09:39:45 +0000 (01:39 -0800)
commit8306b5c9dd933e1c26db0a9eb35b94a863d7e5bc
tree4f4982d5e003c305c682e7cfcb74714f4729a2e1
parent665f174a1eab75d55ef759b6424ce5b678f496df
canonicalize-lgpl: simplify merge to glibc

This patch lessens the differences between git glibc
stdlib/canonicalize.c and lib/canonicalize-lgpl.c.
The (perhaps wishful) goal is to make them identical.
* lib/canonicalize-lgpl.c [!_LIBC]:
Include <libc-config.h>, not config.h.
Omit an unnecessary (!HAVE_CANONICALIZE_FILE_NAME ||
!FUNC_REALPATH_WORKS || defined _LIBC) #if.
Do not include alloca.h, since we use malloca now.
[_LIBC]: Include <eloop-threshold.h>, and define dummy macros
FILE_SYSTEM_PREFIX_LEN, IS_ABSOLUTE_FILE_NAME, ISSLASH, malloca,
freea so that the mainline code can be kept #ifdef free.
[!_LIBC]: Remove dummy macros for SHLIB_COMPAT, versioned_symbol,
compat_symbol, weak_alias, __set_errno since libc-config.h does that.
Add redirecting macros __mempcpy, __pathconf, __rawmemchr,
__eloop_threshold.  All uses of their definiens changed.
(SIZE_MAX): Remove; no longer needed.
(alloc_failed): Remove, and remove all instances.
No need for alloc_failed now that free preserves errno.
(__realpath): Default path_max to 1024 instead of 8192, as that’s
the glibc tradition and is safer when the 2nd argument is null.
Use __rawmemchr instead of strchr.
Use __mempcpy where appropriate.
Simplify test for overflow so that it does not need SIZE_MAX.
Do not preserve errno around free or freea calls; no longer needed.
Mark __realpath with libc_hidden_def.
* modules/canonicalize-lgpl (Depends-on): Add free, libc-config,
malloc-posix, mempcpy, realloc-posix, rawmemchr.
* modules/free: Now LGPLv2+, for canonicalize-lgpl.
ChangeLog
lib/canonicalize-lgpl.c
modules/canonicalize-lgpl
modules/free