Paul Eggert [Mon, 11 Apr 2005 20:21:07 +0000 (20:21 +0000)]
Regenerate.
Paul Eggert [Mon, 11 Apr 2005 20:15:45 +0000 (20:15 +0000)]
Add bulletproofing for cases where stdin, stdout, or stderr are closed.
Paul Eggert [Mon, 11 Apr 2005 20:13:42 +0000 (20:13 +0000)]
Add bulletproofing for cases where stdin, stdout, or stderr are closed.
Paul Eggert [Mon, 11 Apr 2005 20:13:26 +0000 (20:13 +0000)]
Include stdio_safer.h.
(check_file): Don't assume fopen cannot return stdin or stdout.
Paul Eggert [Mon, 11 Apr 2005 20:13:10 +0000 (20:13 +0000)]
(next_file): Don't assume fopen cannot return stdin.
Paul Eggert [Mon, 11 Apr 2005 20:12:51 +0000 (20:12 +0000)]
(have_read_stdin): Remove; no longer needed. All uses
removed.
(tsort): Do not assume fopen can't return stdin.
Close stdin before returning. All uses changed.
Paul Eggert [Mon, 11 Apr 2005 20:12:32 +0000 (20:12 +0000)]
Include unistd-safer.h.
(touch): Use fd_safer.
Paul Eggert [Mon, 11 Apr 2005 20:12:17 +0000 (20:12 +0000)]
Include stdio-safer.h.
(tee): Use fopen_safer.
Paul Eggert [Mon, 11 Apr 2005 20:12:01 +0000 (20:12 +0000)]
Include unistd-safer.h rather than fcntl-safer.h.
(recheck, tail_file): Use fd_safer rather than open_safer.
Paul Eggert [Mon, 11 Apr 2005 20:11:45 +0000 (20:11 +0000)]
Include unistd-safer.h.
(copy_to_temp): Use fd_safer.
(tac_file): Don't assume fopen cannot return stdin.
Paul Eggert [Mon, 11 Apr 2005 20:11:27 +0000 (20:11 +0000)]
(bsd_sum_file, sysv_sym_file):
Use same pattern as elsewhere for checking for stdin.
Paul Eggert [Mon, 11 Apr 2005 20:11:08 +0000 (20:11 +0000)]
Include unistd-safer.h.
(cwrite): Use fd_safer. Replace mystery constant 0666 with symbolic
version, as POSIX requires.
Paul Eggert [Mon, 11 Apr 2005 20:10:52 +0000 (20:10 +0000)]
Include unistd-safer.h.
(create_temp_file): Use fd_safer.
(xfclose): Don't assume fileno (stdin) == STDIN_FILENO, etc.
Paul Eggert [Mon, 11 Apr 2005 20:10:23 +0000 (20:10 +0000)]
Include unistd-safer.h.
(wipename): Use fd_safer on directory file descriptor.
(wipefile): Remove special case for /dev/fd/* on older hosts.
It didn't work in general, and wasn't documented.
Use fd_safer.
Paul Eggert [Mon, 11 Apr 2005 20:10:00 +0000 (20:10 +0000)]
(main): Don't assume fopen returns stdout after closing
stdout. Use freopen instead.
Paul Eggert [Mon, 11 Apr 2005 20:09:42 +0000 (20:09 +0000)]
Include stdio-safer.h.
(open_file): Use fopen_safer.
(close_file): Don't assume fopen does not return stdin.
Paul Eggert [Mon, 11 Apr 2005 20:09:22 +0000 (20:09 +0000)]
(paste_serial): Don't assume fopen does not return stdin.
Paul Eggert [Mon, 11 Apr 2005 20:09:01 +0000 (20:09 +0000)]
(check_and_close): Don't assume fopen does not return stdin.
Paul Eggert [Mon, 11 Apr 2005 20:08:30 +0000 (20:08 +0000)]
Include unistd-safer.h.
(main): Don't dup stderr to stdin or stdout by mistake.
Paul Eggert [Mon, 11 Apr 2005 20:08:11 +0000 (20:08 +0000)]
(digest_file, digest_check):
Don't assume that fopen does not return stdin.
Paul Eggert [Mon, 11 Apr 2005 20:07:54 +0000 (20:07 +0000)]
Include stdio-safer.h.
(main): Use fopen_safer. Simplify the resulting code.
Paul Eggert [Mon, 11 Apr 2005 20:07:37 +0000 (20:07 +0000)]
(head_file): Don't assume open does not return 0.
Paul Eggert [Mon, 11 Apr 2005 20:07:22 +0000 (20:07 +0000)]
(dc_parse_file): Don't assume fopen does not return stdin.
Paul Eggert [Mon, 11 Apr 2005 20:07:00 +0000 (20:07 +0000)]
Include stdio-safer.h.
(input_desc): Remove unnecessary static initialization.
(set_input_file): Use STDIN_FILENO, not 0.
(create_output_file): Use fopen_safer.
Paul Eggert [Mon, 11 Apr 2005 20:06:34 +0000 (20:06 +0000)]
Include unistd-safer.h.
(copy_reg): Use fd_safer.
Paul Eggert [Mon, 11 Apr 2005 20:06:13 +0000 (20:06 +0000)]
Include stdio-safer.h.
(compare_files): Exit right away on I/O error rather than continuing
and producing confusing output and error messages.
Return void, not int; all callers changed.
Use fopen_safer to avoid confusion with file descriptors.
Paul Eggert [Mon, 11 Apr 2005 20:05:45 +0000 (20:05 +0000)]
Add bulletproofing for cases where stdin, stdout, or stderr are closed.
Paul Eggert [Mon, 11 Apr 2005 20:05:34 +0000 (20:05 +0000)]
(gl_PREREQ): Don't require gl_FCNTL_SAFER.
Paul Eggert [Mon, 11 Apr 2005 20:05:20 +0000 (20:05 +0000)]
(gl_UNISTD_SAFER): Use AC_LIBSOURCES and AC_LIBOBJ.
Invoke gl_PREREQ_FD_SAFER.
(gl_PREREQ_FD_SAFER): New macro.
Paul Eggert [Mon, 11 Apr 2005 20:04:57 +0000 (20:04 +0000)]
(gl_STDIO_SAFER): Use AC_LIBSOURCES and AC_LIBOBJ.
Paul Eggert [Mon, 11 Apr 2005 20:04:29 +0000 (20:04 +0000)]
Add bulletproofing for cases where stdin, stdout, or stderr are closed.
Paul Eggert [Mon, 11 Apr 2005 20:03:40 +0000 (20:03 +0000)]
(libfetish_a_SOURCES): Remove dup-safer.c,
fcntl-safer.h, fopen-safer.c, open-safer.c, stdio-safer.h,
unistd-safer.h.
Paul Eggert [Mon, 11 Apr 2005 20:03:22 +0000 (20:03 +0000)]
(fd_safer): New decl.
Paul Eggert [Mon, 11 Apr 2005 20:03:04 +0000 (20:03 +0000)]
Include unistd-safer.h.
(save_cwd): Use fd_safer.
Paul Eggert [Mon, 11 Apr 2005 20:02:43 +0000 (20:02 +0000)]
Include stdio-safer.h.
(getusershell): Use fopen_safer.
Paul Eggert [Mon, 11 Apr 2005 20:02:28 +0000 (20:02 +0000)]
Include unistd-safer.h.
(getloadavg): Use fd_safer.
Paul Eggert [Mon, 11 Apr 2005 20:02:06 +0000 (20:02 +0000)]
Include unistd-safer.h.
(fts_safe_changedir): Use fd_safer.
Paul Eggert [Mon, 11 Apr 2005 20:01:46 +0000 (20:01 +0000)]
Include unistd-safer.h first, to test interface.
(dup_safer) [!deefined F_DUPD]: Use new fd_safer function instead of
rolling our own code.
Paul Eggert [Mon, 11 Apr 2005 20:01:20 +0000 (20:01 +0000)]
Initial revision
Jim Meyering [Sun, 10 Apr 2005 13:44:45 +0000 (13:44 +0000)]
(chopt_free): Mark parameter as unused.
Jim Meyering [Sun, 10 Apr 2005 13:41:44 +0000 (13:41 +0000)]
.
Jim Meyering [Sat, 9 Apr 2005 17:29:20 +0000 (17:29 +0000)]
.
Jim Meyering [Sat, 9 Apr 2005 16:29:29 +0000 (16:29 +0000)]
(close_stdout_wrapper): Likewise.
Don't close STDOUT_FILENO explicitly; close_stdout does it.
Jim Meyering [Sat, 9 Apr 2005 14:19:49 +0000 (14:19 +0000)]
(__attribute__, ATTRIBUTE_UNUSED): Define.
Mark parameter `sp' with ATTRIBUTE_UNUSED.
Jim Meyering [Sat, 9 Apr 2005 14:15:22 +0000 (14:15 +0000)]
(quit): Define with ATTRIBUTE_NORETURN.
Now that close_stdout closes standard output unconditionally,
these workarounds for dd and cat are no longer necessary.
(close_stdout_wrapper): Remove function.
(main): Call atexit with close_stdout, instead.
Jim Meyering [Sat, 9 Apr 2005 14:09:00 +0000 (14:09 +0000)]
*** empty log message ***
Jim Meyering [Sat, 9 Apr 2005 14:08:57 +0000 (14:08 +0000)]
(__attribute__, ATTRIBUTE_UNUSED): Define.
(exit_failure_callback, fallback_failure_callback): Mark unused
parameters with ATTRIBUTE_UNUSED.
Jim Meyering [Sat, 9 Apr 2005 14:08:30 +0000 (14:08 +0000)]
(canon_host) [HAVE_GETADDRINFO]: Use memset
rather than `= { 0 };' to initialize local `hint'.
Jim Meyering [Sat, 9 Apr 2005 13:57:56 +0000 (13:57 +0000)]
*** empty log message ***
Jim Meyering [Sat, 9 Apr 2005 13:57:51 +0000 (13:57 +0000)]
Readability nit:
Change this:
# define __attribute__(x)
to this:
# define __attribute__(x) /* empty */
Jim Meyering [Sat, 9 Apr 2005 13:29:01 +0000 (13:29 +0000)]
*** empty log message ***
Jim Meyering [Sat, 9 Apr 2005 13:28:25 +0000 (13:28 +0000)]
(posixtime) [lint]: Avoid spurious warning from gcc-4's
-Wuninitialized: initialize tm0.tm_year.
Jim Meyering [Sat, 9 Apr 2005 12:35:44 +0000 (12:35 +0000)]
*** empty log message ***
Jim Meyering [Sat, 9 Apr 2005 12:35:41 +0000 (12:35 +0000)]
(humblock): Set *options even when returning due to
xstrtoumax conversion failure. Thanks to a used-uninitialized
warning from gcc-4.
Jim Meyering [Sat, 9 Apr 2005 12:00:36 +0000 (12:00 +0000)]
*** empty log message ***
Jim Meyering [Sat, 9 Apr 2005 11:57:02 +0000 (11:57 +0000)]
*** empty log message ***
Jim Meyering [Sat, 9 Apr 2005 11:56:55 +0000 (11:56 +0000)]
(rm invocation): Say that --recursive removes
listed directories too, not just their contents.
Jim Meyering [Sat, 9 Apr 2005 10:39:17 +0000 (10:39 +0000)]
(usage): Mention that --recursive removes listed
directories too, not just their contents.
Say that by default, rm does not remove directories.
Jim Meyering [Sat, 9 Apr 2005 07:25:06 +0000 (07:25 +0000)]
*** empty log message ***
Jim Meyering [Sat, 9 Apr 2005 07:24:49 +0000 (07:24 +0000)]
(sc_system_h_headers): Propagate exit status through trap.
Jim Meyering [Sat, 9 Apr 2005 07:23:50 +0000 (07:23 +0000)]
Don't include "timespec.h". system.h does that.
Paul Eggert [Sat, 9 Apr 2005 06:16:14 +0000 (06:16 +0000)]
(iread, iwrite): Use char * buffer, not void *, so we can do pointer
arithmetic on it.
Paul Eggert [Sat, 9 Apr 2005 05:03:01 +0000 (05:03 +0000)]
Regenerate.
Paul Eggert [Sat, 9 Apr 2005 05:00:40 +0000 (05:00 +0000)]
Signal-handling cleanup motivated by core dumps in dd.
Paul Eggert [Sat, 9 Apr 2005 04:57:37 +0000 (04:57 +0000)]
(SA_NOCLDSTOP): Define to 0 if not defined.
All uses changed.
(siginterrupt) [! HAVE_SIGINTERRUPT]: New macro.
(main) [! SA_NOCLDSTOP]: Use it.
Paul Eggert [Sat, 9 Apr 2005 04:57:15 +0000 (04:57 +0000)]
Remove all uses of signals; modern hosts have
/dev/random and don't need this gorp.
Do not include signal.h.
(env, sigill_handler, isaac_seed_machdep): Remove. All uses removed.
Paul Eggert [Sat, 9 Apr 2005 04:56:10 +0000 (04:56 +0000)]
(SA_NOCLDSTOP): Define to 0 if not defined.
All uses changed.
(siginterrupt) [! HAVE_SIGINTERRUPT]: New macro.
(main) [! SA_NOCLDSTOP]: Use it.
Paul Eggert [Sat, 9 Apr 2005 04:55:40 +0000 (04:55 +0000)]
Do not include safe-read.h or full-write; no longer needed.
(process_signals): Add forward decl.
(SA_NOCLDSTOP, sigprocmask, sigset_t) [!defined SA_NOCLDSTOP]:
New macros.
(siginterrupt) [! HAVE_SIGINTERRUPT]: New macro.
(SA_NODEFER) [!defined SA_NODEFER]: New macro.
(SA_RESETHAND) [!defined SA_RESETHAND]: New macro.
(caught_signals, interrupt_signal, info_signal_count, catch_siginfo):
New vars.
(usage): Mention -USR1 versus -INFO.
(cleanup): Don't invoke print_stats; the caller must do it now.
All callers changed.
(quit): Process signals just before exiting.
(interrupt_handler): Simply record the signal and return.
(siginfo_handler): Simply increment the signal counter and return.
(install_handler): Remove, replacing with:
(install_signal_handlers, process_signals, iread, iwrite):
New functions. All callers to safe_read and full_write replaced
by iread and iwrite. All callers to install_handler replaced by
install_handlers.
Do not include inttostr.h, no longer needed.
(print_stats, main): Rewrite and simplify formats to use PRIuMAX
instead of umaxtostr.
(print_stats): Work even in languages that have special
forms for two of things, for r_truncate and w_bytes. We can't
fix delta_s in this way, since ngettext doesn't support floating-point.
(main): Rewrite to avoid casts.
Paul Eggert [Sat, 9 Apr 2005 04:55:05 +0000 (04:55 +0000)]
(SA_NOCLDSTOP): Define to 0 if not defined.
All uses changed.
(siginterrupt) [!HAVE_SIGINTERRUPT]: New macro.
(delete_all_files): New arg IN_SIGNAL_HANDLER, to avoid undefined
behavior when called from a signal handler. All uses changed.
(main) [!defined SA_NOCLDSTOP]:
Use siginterrupt to specify that system calls should be interrupted.
Paul Eggert [Sat, 9 Apr 2005 04:54:23 +0000 (04:54 +0000)]
(RETSIGTYPE): Remove; no longer needed. All uses replaced with void.
Paul Eggert [Sat, 9 Apr 2005 04:53:53 +0000 (04:53 +0000)]
(gl_PREREQ_NANOSLEEP): Check for siginterrupt.
Paul Eggert [Sat, 9 Apr 2005 04:52:54 +0000 (04:52 +0000)]
(gl_MACROS): Check for siginterrupt.
(gl_CHECK_ALL_TYPES): Do not require AC_TYPE_SIGNAL.
Paul Eggert [Sat, 9 Apr 2005 04:52:25 +0000 (04:52 +0000)]
(rpl_nanosleep): Include "timespec.h" before macros
that might redefine system include files.
(siginterrupt) [!HAVE_SIGINTERRUPT]: New macro.
(my_usleep): Use NULL rather than (void *) 0.
(rpl_nanosleep) [!defined SA_NOCLDSTOP]:
Use siginterrupt to specify that system calls should be interrupted.
(rpl_nanosleep): Move initialization of suspended closer to call of
my_usleep.
Paul Eggert [Sat, 9 Apr 2005 04:51:52 +0000 (04:51 +0000)]
(dd invocation): Document the distinction between
INFO and USR1 for dd, and the effect of POSIXLY_CORRECT here.
Paul Eggert [Sat, 9 Apr 2005 04:51:11 +0000 (04:51 +0000)]
Document that dd no longer treats QUIT or PIPE specially,
and when conforming to POSIX no longer treats USR1 specially.
Document that dd no longer dumps core when handling signals.
Jim Meyering [Thu, 7 Apr 2005 20:10:54 +0000 (20:10 +0000)]
*** empty log message ***
Jim Meyering [Thu, 7 Apr 2005 20:10:17 +0000 (20:10 +0000)]
*** empty log message ***
Jim Meyering [Thu, 7 Apr 2005 20:10:03 +0000 (20:10 +0000)]
(binary_operator) [LINT]: Initialize lt and rt to 0.
Jim Meyering [Thu, 7 Apr 2005 20:09:46 +0000 (20:09 +0000)]
(digest_check) [LINT]: Initialize hex_digest to NULL.
Jim Meyering [Thu, 7 Apr 2005 17:14:45 +0000 (17:14 +0000)]
*** empty log message ***
Jim Meyering [Thu, 7 Apr 2005 17:14:14 +0000 (17:14 +0000)]
(binop): Move function definition to precede first use so we can...
(binop): ...remove prototype.
Jim Meyering [Thu, 7 Apr 2005 17:12:32 +0000 (17:12 +0000)]
*** empty log message ***
Jim Meyering [Thu, 7 Apr 2005 17:12:27 +0000 (17:12 +0000)]
(is_int, age_of, binop): Declare `char *' parameters to be `const'.
Jim Meyering [Wed, 6 Apr 2005 07:41:20 +0000 (07:41 +0000)]
*** empty log message ***
Jim Meyering [Wed, 6 Apr 2005 07:41:14 +0000 (07:41 +0000)]
Remove rw.
Jim Meyering [Wed, 6 Apr 2005 07:40:51 +0000 (07:40 +0000)]
Remove file -- many invalid message strings.
Paul Eggert [Tue, 5 Apr 2005 22:25:26 +0000 (22:25 +0000)]
Regenerate.
Paul Eggert [Tue, 5 Apr 2005 22:23:29 +0000 (22:23 +0000)]
Add examples to basename, cat, chgrp, chown, dirname.
Paul Eggert [Tue, 5 Apr 2005 22:21:50 +0000 (22:21 +0000)]
(usage): Add examples.
Paul Eggert [Tue, 5 Apr 2005 22:21:14 +0000 (22:21 +0000)]
(.x.1): Remove "COMMAND.td/" from examples.
Paul Eggert [Tue, 5 Apr 2005 22:20:31 +0000 (22:20 +0000)]
Add examples to cat, chown, chgrp, basename, dirname. Change ln examples
to match that format.
Paul Eggert [Tue, 5 Apr 2005 22:20:05 +0000 (22:20 +0000)]
(cat invocation, chown invocation)
(chgrp invocation, basename invocation, dirname invocation):
Add examples, which are copies of the examples newly added
to the usage messages.
(ln invocation): Use same format as other examples above,
for consistency.
Jim Meyering [Tue, 5 Apr 2005 11:53:59 +0000 (11:53 +0000)]
*** empty log message ***
Jim Meyering [Tue, 5 Apr 2005 11:53:47 +0000 (11:53 +0000)]
(usage): Mention that some shells provide a built-in function by the same name.
Jim Meyering [Tue, 5 Apr 2005 11:53:38 +0000 (11:53 +0000)]
(usage): Mention that some shells provide a
built-in function by the same name.
Jim Meyering [Tue, 5 Apr 2005 11:45:49 +0000 (11:45 +0000)]
.
Jim Meyering [Tue, 5 Apr 2005 11:45:06 +0000 (11:45 +0000)]
*** empty log message ***
Jim Meyering [Tue, 5 Apr 2005 11:44:54 +0000 (11:44 +0000)]
(SUBDIRS): Add tee.
Jim Meyering [Tue, 5 Apr 2005 11:44:32 +0000 (11:44 +0000)]
(AC_CONFIG_FILES): Add tests/tee/Makefile.
Jim Meyering [Tue, 5 Apr 2005 11:43:03 +0000 (11:43 +0000)]
.