Age | Commit message (Collapse) | Author |
|
|
|
(LONG_MAX_32_BITS): Remove.
Include <inttypes.h> and <stdint.h> if available.
(alignof, UNALIGNEDP): New macro, portable to all C89 hosts.
(__memrchr): Don't assume unsigned long int is either 4 or 8 bytes;
let it be any number of bytes greater than or equal to 4.
|
|
(LONG_MAX_32_BITS): Remove.
Include <inttypes.h> and <stdint.h> if available.
(alignof, UNALIGNEDP): New macro, portable to all C89 hosts.
(__memchr): Don't assume unsigned long int is either 4 or 8 bytes;
let it be any number of bytes greater than or equal to 4.
* memrchr.c: Likewise, with __memrchr.
|
|
|
|
suffices with C89 or better.
(alignof): New macro, portable to all C89 hosts.
(UNALIGNED): Use it. Use uintptr_t if available, and assume
everything is unaligned otherwise; this is more portable than
assuming 'unsigned long int' will always work.
|
|
ifdef _LIBC.
(md5_uint32): Use uint32_t if available. Simplify fallback ifdefs.
|
|
(EOVERFLOW): Define if not defined.
(getgroups): Return -1 with errno=EOVERFLOW if an integer overflow
occurs.
|
|
|
|
|
|
eaccess on Solaris and SVR4-like systems.
(euidaccess): Use HAVE_EACCESS, not HAVE_DECL_EACCESS.
|
|
|
|
you need to include first. You don't need to include any files
other than the usual config.h.
Include <inttypes.h> and <stdint.h> if available, for uintmax_t.
Remove 'struct stat;' not needed since we know sys/stat.h has
been included by dev-ino.h.
(struct cycle_check_state): Change chdir_counter to uintmax_t,
not size_t, since it isn't limited by object sizes.
Change magic from long unsigned int to int; that's good enough
for our use.
|
|
is_power_of_two, to reflect better what it really does.
All uses changed. Arg is now uintmax_t, not unsigned int
(it should have been unsigned long int -- that was a bug).
(cycle_check): Check for integer overflow in cycle count,
and report a cycle if that happens, as it must be a cycle
by this point.
|
|
|
|
|
|
|
|
numeric backup extensions.
Include "backupfile.h" first.
Include errno.h, stdbool.h, limits.h, unistd.h, xalloc.h.
(CLOSEDIR, INT_STRLEN_BOUND): Remove.
(pathconf) [! (HAVE_PATHCONF && defined _PC_NAME_MAX)]: New macro.
(_POSIX_NAME_MAX) [!defined _POSIX_NAME_MAX]: New macro.
(NAME_MAX_MAXIMUM): New macro. Unlike the old addext.c, we
also look at _XOPEN_NAME_MAX, for better performance on modern
hosts that support only file names of length 255 or more.
(ISDIGIT): unsigned -> unsigned int
(max_backup_version, version_number): Remove.
(check_extension): New function. Similar to the old addext, but
static, assumes that the extension has already been added,
and a bit more careful on DOS hosts.
(numbered_backup): New function. It does what max_backup_version
and version_number used to do, but it doesn't use integer arithmetic
to calculate extensions so it doesn't overflow.
(find_backup_file_name): Rewrite to use these new functions.
This has a new optimization: we needn't call pathconf if the
new numbered backup name has the same length as the old.
Also, use xmalloc rather than malloc, so that the caller
needn't worry about memory exhaustion.
|
|
|
|
|
|
|
|
(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 down 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".
|
|
|
|
|
|
|
|
|
|
|
|
if HAVE_GETLOADAVG is defined, so that the test program can work.
(errno): Remove declaration; not needed in C89 or later.
Include "c-strtod.h".
Do not include locale.h or define setlocale; no longer needed.
Include <limits.h>.
(INT_STRLEN_BOUND): New macro.
(getloadavg): Use it to compute buffer size.
Don't assume that buffer will be properly terminated by 'read'.
Use c_strtod instead of setlocale.
(main) [defined TEST]: Return int, not void.
|
|
(C_STRTOD) [defined LC_ALL_MASK]: Use it, so that the
code is reentrant on platforms that have strtod_l.
|
|
|
|
|
|
|
|
|
|
(C_STRTOD, DOUBLE, STRTOD): New macros.
(c_strtod): Use them.
|
|
|
|
|
|
Detect symlink loops much earlier (albeit lazily) on systems
with MAXSYMLINKS defined to a large value.
Include "cycle-check.h".
(canonicalize_filename_mode): Don't try to detect loops by counting
symlink-hops. Instead, use the cycle-check module.
|
|
Forward-declare `struct stat'.
|
|
|
|
Replace each corresponding `break' stmt with `continue'.
|
|
|
|
(canonicalize_filename_mode): Remove #ifdef S_ISLNK, now that
S_ISLNK is guaranteed to be defined (via stat-macros.h).
|
|
|
|
|
|
|
|
(canonicalize_filename_mode): New function, based on
canonicalize_file_name, supports three canonicalize modes.
(canonicalize_file_name)
[!HAVE_CANONICALIZE_FILE_NAME && !HAVE_RESOLVEPATH]: Use 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.
|
|
|