Paul Eggert [Thu, 12 Aug 2004 08:02:31 +0000 (08:02 +0000)]
(gl_ARGP): Do not check for argp.h or argp_parse; nobody
uses HAVE_ARGP_H or HAVE_ARGP_PARSE.
Require gl_FUNC_GLIBC_UNLOCKED_IO, gl_USE_SYSTEM_EXTENSIONS.
Check for program_invocation_name, program_invocation_short_name,
flockfile, funlockfile, features.h, _getopt_long_only_r.
Paul Eggert [Thu, 12 Aug 2004 07:57:52 +0000 (07:57 +0000)]
Use "gettext.h" instead of its complicated substitute.
(N_): Define unconditionally.
(argp_default_options): Fill out initializers with 0 to avoid
gcc warnings.
Paul Eggert [Thu, 12 Aug 2004 07:57:07 +0000 (07:57 +0000)]
Use "gettext.h" instead of its complicated substitute.
Include <errno.h>, for program_invocation_short_name
and program_invocation_name.
(__argp_basename) [!_LIBC]: Remove; the only use was
replaced by its body.
(__argp_short_program_name): Change condition from
!defined __argp_short_program_name to
! (defined _LIBC || HAVE_DECL_PROGRAM_INVOCATION_SHORT_NAME),
to match argp-namefrob.h.
(__argp_failure): Don't assume strerror_r returns char *.
Paul Eggert [Wed, 11 Aug 2004 22:39:58 +0000 (22:39 +0000)]
Include <inttypes.h> and <stdint.h> if available.
(union fooround): Use uintmax_t, not long int.
The rest is a merge from libc:
[defined _LIBC]: Include <shlib-compat.h>.
(_obstack) [defined _LIBC]: Remove after 2.3.4.
Paul Eggert [Tue, 10 Aug 2004 03:46:10 +0000 (03:46 +0000)]
Put the UTF-8 comment in an m4 comment, not a shell comment, so that
we don't put UTF-8 text into "configure". "configure" might contain
non-UTF-8 text, and we don't want to confuse matters.
Paul Eggert [Sat, 7 Aug 2004 06:43:34 +0000 (06:43 +0000)]
(make_hol, hol_append): Don't assume that
SIZE_MAX is a valid preprocessor constant.
(__argp_basename): Change from "#ifndef _LIBC"
to "#ifndef __argp_short_program_name", so that
we don't compile these functions for tar.
Paul Eggert [Fri, 6 Aug 2004 23:44:59 +0000 (23:44 +0000)]
(gl_PREREQ_EUIDACCESS): Don't bother checking for
unistd.h, as autoconf does this for us. Check for libgen.h.
Also look for eaccess within -lgen, which is where it is in
Solaris. Set LIB_EACCESS accordingly.
(gl_FUNC_NONREENTRANT_EUIDACCESS): New macro.
(gl_FUNC_EUIDACCESS): Use AC_CHECK_DECLS_ONCE, not AC_CHECK_DECLS.
(gl_PREREQ_EUIDACCESS): Check for eaccess and setregid decls.
Require AC_HEADER_STAT.
Paul Eggert [Fri, 6 Aug 2004 23:44:27 +0000 (23:44 +0000)]
[HAVE_LIBGEN_H]: Include <libgen.h>, for
eaccess on Solaris and SVR4-like systems.
(euidaccess): Use HAVE_EACCESS, not HAVE_DECL_EACCESS.
[!defined LIBC]: Included group-member.h, stat-macros.h.
(S_IXUSR, S_IXGRP, S_IXOTH, S_IROTH, S_IWOTH, S_IXOTH):
Remove; now done by stat-macros.h.
(NGROUPS_MAX, group_member): Remove; now done by group-member.h.
No need to include <limits.h>.
(errno): Remove decl; we now assume C89 or better.
(access, getuid, getgid, geteuid, getegid, stat) [defined _LIBC]:
New macros.
(uid, gid, have_ids): Remove these static variables.
They weren't accurate for programs that also invoked setreuid etc.
(euidaccess) [defined EFF_ONLY_OK || defined ACC_SELF ||
HAVE_DECL_EACCSS]: Use builtin substitutes.
[defined _LIBC]: Ignore __libc_enable_secure; it's not a
correct optimization for programs run as root that later
invoke setreuid.
[no builtin substitutes && HAVE_DECL_SETREGID &&
PREFER_NONREENTRANT_EUIDACCESS]:
Use setreuid+setregid to get the correct answer.
[no builtin substitutes && ! (HAVE_DECL_SETREGID &&
PREFER_NONREENTRANT_EUIDACCESS)]:
Don't assume that the stat macros have their historical values,
as POSIX doesn't require this.
[defined TEST]: Include <stdlib.h>; don't include errno.h
twice; include <error.h> rather than "error.h".
Paul Eggert [Fri, 6 Aug 2004 04:48:31 +0000 (04:48 +0000)]
(mempcpy): Don't define if a system header defines it.
Don't include stdio.h, stdlib.h, unistd.h, strdup.h.
(longest_relative_suffix): New function.
(path_concat): Use it. Assume first argument is not NULL.
Port to DOS. Omit redundant separators.
Report an error instead of returning NULL.
Use mempcpy instead of memcpy.
(xpath_concat): Remove: not declared or used.
Paul Eggert [Fri, 6 Aug 2004 04:21:07 +0000 (04:21 +0000)]
Include <stdbool.h>.
(FILE_SYSTEM_PREFIX_LEN): Renamed from FILESYSTEM_PREFIX_LEN,
for consistency with POSIX terminology. All uses changed.
(IS_ABSOLUTE_FILE_NAME, IS_RELATIVE_FILE_NAME): New macros.
(strip_trailing_slashes): Use bool for booleans.
Paul Eggert [Thu, 5 Aug 2004 23:39:18 +0000 (23:39 +0000)]
Work around bug in OpenBSD 3.4 sterror_r: it
sometimes returns a positive errno value even when it succeeds.
(print_errno_message) [!LIBC]: Fall back on strerror if
__strerror_r fails.