Age | Commit message (Collapse) | Author |
|
no file operand is given, and standard input is any FIFO.
|
|
* src/tail.c: Include isapipe.h.
(IS_PIPE_LIKE_FILE_TYPE): Remove.
(IS_TAILABLE_FILE_TYPE): Just list both FIFOs and sockets as
tailable, since this seems to be portable.
(main): Use isapipe, to fix a bug on MacOS X reported by Bruno Haible in
<http://lists.gnu.org/archive/html/bug-coreutils/2006-08/msg00304.html>.
|
|
only if standard input is a FIFO or pipe and POSIXLY_CORRECT is set.
|
|
numeric option in an invalid way.
|
|
to put a regular file in O_NONBLOCK mode fails with EPERM.
That happens on Linux when using tail -f on a file with the
append-only attribute. Reported by Dean Gaudet. For details,
see http://savannah.gnu.org/bugs/?func=detailitem&item_id=15473.
|
|
It's already defined in "system.h".
|
|
is useful `mainly' (not `only') when following by name.
Reported here: http://bugs.debian.org/273781
|
|
testing-only option to start with `-', so that it cannot render
ambiguous any prefix it happens to share with some other option name.
|
|
|
|
You can use --retry instead.
|
|
TIMESPEC_NS macro.
|
|
parameter and associated assertion. Adjust all callers.
|
|
Avoid setmode; use POSIX-specified routines instead.
|
|
(recheck, tail_file): Don't call fd_safer; no longer needed
now that we include fcntl--.h.
|
|
Rather than this: error (..., "...`%s'...", arg);
do this: error (..., "...%s...", quote (arg));
|
|
|
|
|
|
|
|
(recheck, tail_file): Use fd_safer rather than open_safer.
|
|
|
|
(IS_TAILABLE_FILE_TYPE): Adjust definition also to include
sockets, since that's what you get when reading from a command-line-
supplied pipe on Darwin 7.7.
(IS_PIPE_LIKE_FILE_TYPE): Define.
(main): Use new IS_PIPE_LIKE_FILE_TYPE rather than simply S_ISFIFO.
This same change is also required on NetBSD/sparc-1.5.
Reported by Adrian Bunk.
|
|
|
|
Reported by Nik A. Melchior in http://bugs.debian.org/273781.
|
|
for obsolete option followed by non-obsolete, or by more
than one file. When obsolete, conform to SUSv2 rather than
original POSIX 1003.2-1992, as SUSv2 corrected the case of
"tail -c". Add support for the SUSv2 "b" modifier.
|
|
|
|
parse_obsolescent_option, since the options are obsolete now.
Remove bool *arg; just exit if there's an error. Revamp to follow
POSIX 1003.2-1992 more precisely, to handle cases like "tail -
file" and "tail -10 -- file" correctly when we are conforming to
the older standard.
(main): Adjust to this change.
|
|
forever, from_start, print_headers, have_read_stdin, valid_file_spec,
write_header, file_lines, pipe_lines, pipe_bytes, recheck,
tail_forever, tail_bytes, tail_lines, tail, tail_file,
parse_obsolescent_option, parse_options, main):
Use bool for booleans.
(struct File_spec, max_n_unchanged_stats_between_opens,
parse_options): Use uintmax_t, not unsigned int or unsigned long int,
for state counters.
(tail_bytes, tail_lines): Redo test of return value (-1, 0, 1) to
make it a bit clearer.
|
|
(COPY_TO_EOF): Set to UINTMAX_MAX, not OFF_T_MAX (which was wrong).
(COPY_A_BUFFER): New macro.
(struct File_spec): New members mtime, mode, blocking.
Remove member n_consecutive_size_changes.
(DEFAULT_MAX_N_CONSECUTIVE_SIZE_CHANGES,
max_n_consecutive_size_changes_between_opens,
MAX_CONSECUTIVE_SIZE_CHANGES_OPTION): Remove.
(long_options, tail_forever, parse_options):
Remove (non-)support for --max-consecutive-size-changes.
(record_open_fd): New function.
(recheck, tail_file): Use it. Don't assume that stdin is open.
(dump_remainder): Add support for new COPY_A_BUFFER special value.
Treat errno==EAGAIN like EOF, since it might be a nonblocking read.
(recheck): New arg BLOCKING, specifying whether to use blocking reads.
All uses changed.
(n_live_files): Remove, replacing with...
(any_live_files): New function. All uses changed.
(tail_forever): Use nonblocking I/O unless we know that blocking I/O
is safe; this avoids some hangs when reading from a fifo.
Avoid invoking fstat or sleep when using blocking I/O.
Do not check for changes to size if the file is not a regular file,
as the size is undefined in that case.
Check for changes to mtime or mode, too; this works for non-regular
files.
(tail_forever, main): Redo fflush strategy to work even when input
is nonblocking. Don't use unbuffered output; just flush when needed.
|
|
and standard input is a pipe.
|
|
even if POSIXLY_CORRECT, since POSIX does not require a diagnostic.
|
|
|
|
(usage): Don't bother normalizing exit status
since the arg is already the correct exit status now.
|
|
|
|
Fail when following by name but no names are specified.
|
|
(parse_options): Update xstrtod call to include new argument, c_strtod.
|
|
of 2003-09-19. Now, AUTHORS is a comma-separated list of strings.
Update the call to parse_long_options so that `AUTHORS, NULL' are the
last parameters.
* src/true.c (main): Append NULL to version_etc argument list.
* src/sys2.h (case_GETOPT_VERSION_CHAR): Likewise.
|
|
gcc's warning about shadowing a global.
|
|
Begin each WRITTEN_BY string with `Written by ' and end it with `.'.
Mark each WRITTEN_BY string as translatable.
|
|
|
|
the call to parse_long_options so that `AUTHORS, NULL' are the last parameters.
|
|
(parse_options): Give a diagnostic for (but still accept) the
deprecated --allow-missing option.
|
|
(struct linebuffer, struct charbuffer): Change nbytes and nlines from
unsigned int to size_t. unsigned int is safe (after the 2003-09-03 patch)
but size_t is cleaner.
(pipe_bytes): Likewise for local variable 'i', which was 'int'.
Standardize on BUFSIZ as opposed to other macro names and values.
(BUFSIZ) [!defined BUFSIZ]: Remove. stdio.h has always defined it,
and other code already assumes it's defined.
|
|
|
|
race condition bug. The bug would be triggered when tailing a file
with file pointer not at beginning of file, and where the file was
truncated to have a length of less than the initial offset at just
the right moment (between the two lseek calls in this function).
|
|
`tail -n0 -f FILE' and `tail -c0 -f FILE' doing what amounted to a
busy-wait rather than sleeping between iterations. The bug manifests
itself only when tailing regular files that are initially nonempty.
(tail_bytes): Set *read_pos to new file offset after
each xlseek call.
(tail_lines): Likewise, after lseek calls.
|
|
|
|
|
|
|
|
Don't include closeout.h.
|
|
|