Commit Graph

18971 Commits

Author SHA1 Message Date
Paul Eggert
f8fe7f2e43 Regenerate. 2004-07-28 22:32:26 +00:00
Paul Eggert
ef6b50199e memchr and memrchr portability fixes. 2004-07-28 22:21:33 +00:00
Paul Eggert
8792823f5c Include <stddef.h>, not <stdlib.h> and <sys/types.h>.
(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.
2004-07-28 22:21:18 +00:00
Paul Eggert
5048f3461c Include <stddef.h>, not <stdlib.h> and <sys/types.h>.
(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.
2004-07-28 22:20:56 +00:00
Paul Eggert
9f09a96f97 md5, sha1 cleanups; getugroups change. 2004-07-28 20:11:45 +00:00
Paul Eggert
926de77e69 md5, sha1 cleanups. 2004-07-28 20:10:55 +00:00
Paul Eggert
2146f830d2 (gl_SHA): Require AC_C_BIGENDIAN. 2004-07-28 20:10:44 +00:00
Paul Eggert
c01cc5cfaa (gl_MD5): Do not require AC_C_INLINE, since it doesn't
use inline any more.  Require AC_C_BIGENDIAN, though.
2004-07-28 20:10:18 +00:00
Paul Eggert
94185e124d Don't include <sys/types.h> or <stdlib.h>; <stddef.h>
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.
2004-07-28 20:09:39 +00:00
Paul Eggert
4b7668c12a Include <stdint.h> if HAVE_STDINT_H || _LIBC, not
ifdef _LIBC.
(md5_uint32): Use uint32_t if available.  Simplify fallback ifdefs.
2004-07-28 20:09:09 +00:00
Paul Eggert
7c6ecf213a Include <errno.h>.
(EOVERFLOW): Define if not defined.
(getgroups): Return -1 with errno=EOVERFLOW if an integer overflow
occurs.
2004-07-28 19:41:08 +00:00
Paul Eggert
a0cc71ff25 Regenerate. 2004-07-28 19:26:33 +00:00
Paul Eggert
ed996f7489 Don't assume that Perl's getpwd agrees with ours. 2004-07-28 19:23:28 +00:00
Paul Eggert
f4bc6c5d12 Don't assume that Perl's getpwd agrees with our
pwd when there are multiple names for the working directory
(which can happen with an automounter, sigh).
2004-07-28 19:23:07 +00:00
Paul Eggert
d2d008b6fe In src/Makefile.am, don't have 'groups' or 'localedir.h' depend on Makefile. 2004-07-28 18:54:05 +00:00
Paul Eggert
a60f136da2 this causes Solaris 8 'make' to refuse to build "groups".
(localedir.h): Don't depend on Makefile: this causes Solaris
8 'make' to build localedir.h unnecessarily.  The dependence
on Makefile is ineffective anyway, since $(localedir) might
change even if Makefile hasn't.
2004-07-28 18:53:22 +00:00
Paul Eggert
1cb2521b31 * src/remove.c (remove_dir): If we can't save the state of the
working directory, pretend we started from "/", not ".".
2004-07-28 14:50:25 +00:00
Paul Eggert
5bfb177670 (remove_dir): If we can't save the state of the
working directory, pretend we started from "/", not ".".
This avoids a bug on hosts like Solaris that don't let you
remove the working directory.
2004-07-28 14:50:06 +00:00
Paul Eggert
02b3090917 In src/printf.c, declare strtoimax and strtoumax if not already declared. 2004-07-28 06:59:27 +00:00
Paul Eggert
713c2a319a (strtiomax, strtoumax): Declare if not already
declared: this fixes a portability bug with Solaris 8 + GCC.
(STRTOX): Parenthesize use of macro arg as expression.
(vstrtoimax, vstrtoumax, vstrtold): Remove now-unnecessary
parentheses.
2004-07-28 06:58:25 +00:00
Paul Eggert
2cc7823212 Check for declaration of strtoumax, for src/printf.c. 2004-07-28 06:58:09 +00:00
Paul Eggert
62824b327f Regenerate. 2004-07-28 05:26:31 +00:00
Paul Eggert
db1c6c3879 Get eaccess from libgen if available; that's where it is on Solaris 9. 2004-07-28 05:02:17 +00:00
Paul Eggert
84af134c5a (cp_LDADD, ginstall_LDADD, mv_LDADD,
pathchk_LDADD, rm_LDADD, test_LDADD): New vars, for eaccess.
2004-07-28 05:00:35 +00:00
Paul Eggert
3829b4e3ef (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.
2004-07-28 05:00:10 +00:00
Paul Eggert
dd0eaccf28 euidaccess.c [HAVE_LIBGEN_H]: Include <libgen.h>, for
eaccess on Solaris and SVR4-like systems.
(euidaccess): Use HAVE_EACCESS, not HAVE_DECL_EACCESS.
2004-07-28 04:59:44 +00:00
Paul Eggert
d08db2a02a cycle-check integer overflow fixup. 2004-07-28 00:31:58 +00:00
Paul Eggert
6cb7a76f8e Remove now-inaccurate comment about the files
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.
2004-07-28 00:31:14 +00:00
Paul Eggert
62ce2087cb (is_zero_or_power_of_two): Renamed from
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.
2004-07-28 00:30:45 +00:00
Paul Eggert
43309787ce Don't assume that we can remove the working directory in tests. 2004-07-28 00:06:57 +00:00
Paul Eggert
eba892da25 Regenerate. 2004-07-27 23:20:48 +00:00
Paul Eggert
5a0e4bcd67 Merged into backupfile.c. 2004-07-27 23:20:03 +00:00
Paul Eggert
0dd8a47056 backupfile integer overflow fixups 2004-07-27 23:15:05 +00:00
Paul Eggert
94a410b48a backupfile integer overflow fixups 2004-07-27 23:14:53 +00:00
Paul Eggert
9dfcfc47dc (do_link): find_backup_file_name no longer returns NULL, so don't
bother to check for this.
2004-07-27 23:14:30 +00:00
Paul Eggert
53b24fa527 (do_copy): find_backup_file_name no longer returns NULL, so don't
bother to check for this.
2004-07-27 23:14:05 +00:00
Paul Eggert
c3d37adf6d (copy_internal): find_backup_file_name no longer
returns NULL, so don't bother to check for this.
2004-07-27 23:13:38 +00:00
Paul Eggert
967a08d520 (gl_BACKUPFILE): AC_REQUIRE
gl_CHECK_TYPE_STRUCT_DIRENT_D_INO instead of invoking it directly.
Do not require AC_FUNC_CLOSEDIR_VOID.
2004-07-27 23:13:17 +00:00
Paul Eggert
1b94625f19 backupfile.c rewrite to avoid arbitrary limits on lengths of
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.
2004-07-27 23:12:56 +00:00
Paul Eggert
bdf757d699 backupfile.h (addext): Remove decl. 2004-07-27 23:12:17 +00:00
Paul Eggert
4e5aa1e97b (libfetish_a_SOURCES): Remove addext.c. 2004-07-27 23:11:55 +00:00
Paul Eggert
362264b40d Regenerate. 2004-07-26 06:14:11 +00:00
Paul Eggert
218f93ec2c (GET_NICE_VALUE): Renamed from GET_PRIORITY.
All uses changed.
(NZERO): New macro, if system doesn't define it already.
(usage): Distinguish priorities from nice values.
Don't assume NZERO is 20.
(main): Use bool instead of int where appropriate.
If user specifies an adjustment out of range, always truncate it
to an inrange value instead of sometimes giving an error message
and sometimes not.
Do not assume that -1 is an error return from "nice" or
"getpriority", as it might be the current nice value minus NZERO.
If nice/setpriority fails with errno == EPERM, go ahead and run
the command anyway; POSIX requires this.
2004-07-26 06:08:50 +00:00
Paul Eggert
b41eb892ea (nice invocation): Document the "nice value", and
how it affects the scheduling priority.  (The old documentation
implied that the nice value equaled the scheduling priority, which
isn't accurate.)  Document that the range of nice values might
exceed -20..19.  Specify what happens when you give a nice value
that is out of range, or when you don't have permissions to lower
the nice value.  Bash doesn't have a builtin 'nice', so don't say
"most shells" have one.
2004-07-26 06:08:18 +00:00
Paul Eggert
3bc83c8a92 Document portability and POSIX fixes for "nice". 2004-07-26 06:07:40 +00:00
Paul Eggert
a4dec5db91 Portability and POSIX fixes for "nice". 2004-07-26 06:07:04 +00:00
Paul Eggert
7200b3e37d Portability and POSIX fixes for "nice". 2004-07-26 06:06:30 +00:00
Paul Eggert
e86b28dc3d Remove setreuid/setregid test from gl_MACROS. 2004-07-25 23:01:23 +00:00
Paul Eggert
3092c8fa01 Update serial number. 2004-07-25 23:00:47 +00:00
Paul Eggert
f22603b500 (gl_MACROS): Remove test for setreuid and setregid,
as test.c no longer uses them directly.
2004-07-25 23:00:11 +00:00