Paul Eggert
786ebb2cec
Include stdio_safer.h.
...
(check_file): Don't assume fopen cannot return stdin or stdout.
2005-04-11 20:13:26 +00:00
Paul Eggert
45e6c262b9
(next_file): Don't assume fopen cannot return stdin.
2005-04-11 20:13:10 +00:00
Paul Eggert
8e8520b0ba
(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.
2005-04-11 20:12:51 +00:00
Paul Eggert
39d496f075
Include unistd-safer.h.
...
(touch): Use fd_safer.
2005-04-11 20:12:32 +00:00
Paul Eggert
857b9db0e0
Include stdio-safer.h.
...
(tee): Use fopen_safer.
2005-04-11 20:12:17 +00:00
Paul Eggert
99eb6d3a02
Include unistd-safer.h rather than fcntl-safer.h.
...
(recheck, tail_file): Use fd_safer rather than open_safer.
2005-04-11 20:12:01 +00:00
Paul Eggert
9db4c89700
Include unistd-safer.h.
...
(copy_to_temp): Use fd_safer.
(tac_file): Don't assume fopen cannot return stdin.
2005-04-11 20:11:45 +00:00
Paul Eggert
da5dc50751
(bsd_sum_file, sysv_sym_file):
...
Use same pattern as elsewhere for checking for stdin.
2005-04-11 20:11:27 +00:00
Paul Eggert
a498869855
Include unistd-safer.h.
...
(cwrite): Use fd_safer. Replace mystery constant 0666 with symbolic
version, as POSIX requires.
2005-04-11 20:11:08 +00:00
Paul Eggert
66729cdcd3
Include unistd-safer.h.
...
(create_temp_file): Use fd_safer.
(xfclose): Don't assume fileno (stdin) == STDIN_FILENO, etc.
2005-04-11 20:10:52 +00:00
Paul Eggert
0d49dd9de2
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.
2005-04-11 20:10:23 +00:00
Paul Eggert
caca482cde
(main): Don't assume fopen returns stdout after closing
...
stdout. Use freopen instead.
2005-04-11 20:10:00 +00:00
Paul Eggert
02b7510866
Include stdio-safer.h.
...
(open_file): Use fopen_safer.
(close_file): Don't assume fopen does not return stdin.
2005-04-11 20:09:42 +00:00
Paul Eggert
c2377708ec
(paste_serial): Don't assume fopen does not return stdin.
2005-04-11 20:09:22 +00:00
Paul Eggert
ab860aae65
(check_and_close): Don't assume fopen does not return stdin.
2005-04-11 20:09:01 +00:00
Paul Eggert
8e14d7ffbb
Include unistd-safer.h.
...
(main): Don't dup stderr to stdin or stdout by mistake.
2005-04-11 20:08:30 +00:00
Paul Eggert
e972b27d05
(digest_file, digest_check):
...
Don't assume that fopen does not return stdin.
2005-04-11 20:08:11 +00:00
Paul Eggert
aba88afdce
Include stdio-safer.h.
...
(main): Use fopen_safer. Simplify the resulting code.
2005-04-11 20:07:54 +00:00
Paul Eggert
ea778b6463
(head_file): Don't assume open does not return 0.
2005-04-11 20:07:37 +00:00
Paul Eggert
cc4407f0fe
(dc_parse_file): Don't assume fopen does not return stdin.
2005-04-11 20:07:22 +00:00
Paul Eggert
329448f75e
Include stdio-safer.h.
...
(input_desc): Remove unnecessary static initialization.
(set_input_file): Use STDIN_FILENO, not 0.
(create_output_file): Use fopen_safer.
2005-04-11 20:07:00 +00:00
Paul Eggert
0b8c662cf2
Include unistd-safer.h.
...
(copy_reg): Use fd_safer.
2005-04-11 20:06:34 +00:00
Paul Eggert
fd48557688
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.
2005-04-11 20:06:13 +00:00
Paul Eggert
aaffac9b6a
Add bulletproofing for cases where stdin, stdout, or stderr are closed.
2005-04-11 20:05:45 +00:00
Paul Eggert
791d815ca0
(gl_PREREQ): Don't require gl_FCNTL_SAFER.
2005-04-11 20:05:34 +00:00
Paul Eggert
366a942b4d
(gl_UNISTD_SAFER): Use AC_LIBSOURCES and AC_LIBOBJ.
...
Invoke gl_PREREQ_FD_SAFER.
(gl_PREREQ_FD_SAFER): New macro.
2005-04-11 20:05:20 +00:00
Paul Eggert
ed8af4543d
(gl_STDIO_SAFER): Use AC_LIBSOURCES and AC_LIBOBJ.
2005-04-11 20:04:57 +00:00
Paul Eggert
6a0400397d
Add bulletproofing for cases where stdin, stdout, or stderr are closed.
2005-04-11 20:04:29 +00:00
Paul Eggert
5af96ecaf5
(libfetish_a_SOURCES): Remove dup-safer.c,
...
fcntl-safer.h, fopen-safer.c, open-safer.c, stdio-safer.h,
unistd-safer.h.
2005-04-11 20:03:40 +00:00
Paul Eggert
6d2aaeaa97
(fd_safer): New decl.
2005-04-11 20:03:22 +00:00
Paul Eggert
24560041a8
Include unistd-safer.h.
...
(save_cwd): Use fd_safer.
2005-04-11 20:03:04 +00:00
Paul Eggert
f4efb825d2
Include stdio-safer.h.
...
(getusershell): Use fopen_safer.
2005-04-11 20:02:43 +00:00
Paul Eggert
8bd8ca4bf3
Include unistd-safer.h.
...
(getloadavg): Use fd_safer.
2005-04-11 20:02:28 +00:00
Paul Eggert
01dbbdf612
Include unistd-safer.h.
...
(fts_safe_changedir): Use fd_safer.
2005-04-11 20:02:06 +00:00
Paul Eggert
74fdf19ae7
Include unistd-safer.h first, to test interface.
...
(dup_safer) [!deefined F_DUPD]: Use new fd_safer function instead of
rolling our own code.
2005-04-11 20:01:46 +00:00
Paul Eggert
10bcc8d795
Initial revision
2005-04-11 20:01:20 +00:00
Jim Meyering
faac042790
(chopt_free): Mark parameter as unused.
2005-04-10 13:44:45 +00:00
Jim Meyering
084e64d1b7
.
2005-04-10 13:41:44 +00:00
Jim Meyering
31d1fd1eef
.
2005-04-09 17:29:20 +00:00
Jim Meyering
493aba2ae5
(close_stdout_wrapper): Likewise.
...
Don't close STDOUT_FILENO explicitly; close_stdout does it.
2005-04-09 16:29:29 +00:00
Jim Meyering
c06188c05c
(__attribute__, ATTRIBUTE_UNUSED): Define.
...
Mark parameter `sp' with ATTRIBUTE_UNUSED.
2005-04-09 14:19:49 +00:00
Jim Meyering
e115c60a2a
(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.
2005-04-09 14:15:22 +00:00
Jim Meyering
58415b5d5d
*** empty log message ***
2005-04-09 14:09:00 +00:00
Jim Meyering
c522a489df
(__attribute__, ATTRIBUTE_UNUSED): Define.
...
(exit_failure_callback, fallback_failure_callback): Mark unused
parameters with ATTRIBUTE_UNUSED.
2005-04-09 14:08:57 +00:00
Jim Meyering
22210b83b4
(canon_host) [HAVE_GETADDRINFO]: Use memset
...
rather than `= { 0 };' to initialize local `hint'.
2005-04-09 14:08:30 +00:00
Jim Meyering
32e72c50cc
*** empty log message ***
2005-04-09 13:57:56 +00:00
Jim Meyering
0eb83b6534
Readability nit:
...
Change this:
# define __attribute__(x)
to this:
# define __attribute__(x) /* empty */
2005-04-09 13:57:51 +00:00
Jim Meyering
517ac833b0
*** empty log message ***
2005-04-09 13:29:01 +00:00
Jim Meyering
5fb6300448
(posixtime) [lint]: Avoid spurious warning from gcc-4's
...
-Wuninitialized: initialize tm0.tm_year.
2005-04-09 13:28:25 +00:00
Jim Meyering
71984394f3
*** empty log message ***
2005-04-09 12:35:44 +00:00