summaryrefslogtreecommitdiff
path: root/src/tail.c
AgeCommit message (Collapse)Author
2006-10-25* src/cat.c (infile): Add "const" to declaration.Jim Meyering
* src/csplit.c (prefix): Likewise. * src/printf.c (cfcc_msg): Likewise. * src/tail.c (valid_file_spec): Likewise. * src/cut.c (cut_file): Likewise, for a parameter. * src/expr.c (str_value): Likewise. * src/fold.c (fold_file): Likewise. * src/pr.c (init_header): Likewise. * src/dircolors.c (dc_parse_stream): Likewise, for a local. * src/tr.c (make_printable_str): Likewise. * src/nl.c (body_type, header_type, footer_type, current_type): (separator_str, build_type_arg, nl_file): Likewise, for many. * src/paste.c (main): Don't assign a read-only string to 'optarg'. * src/tac.c (separator, tac_seekable, copy_to_temp): Likewise.
2006-09-08tail now ignores the -f option if POSIXLY_CORRECT is set,Paul Eggert
no file operand is given, and standard input is any FIFO.
2006-08-29* bootstrap.conf (gnulib_modules): Add isapipe.Paul Eggert
* 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>.
2006-07-01(main): With no operand, 'tail -f' now silently ignores the '-f'Paul Eggert
only if standard input is a FIFO or pipe and POSIXLY_CORRECT is set.
2006-01-31(parse_options): Use a better diagnostic when someone uses a trailingPaul Eggert
numeric option in an invalid way.
2006-01-24(tail_forever): Don't exit-nonzero when an attemptJim Meyering
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.
2006-01-05(ENOSYS) [!defined ENOSYS]: Don't define here.Jim Meyering
It's already defined in "system.h".
2006-01-02(parse_options): Change warning to say that --retryJim Meyering
is useful `mainly' (not `only') when following by name. Reported here: http://bugs.debian.org/273781
2005-12-03(long_options): Change the name of each undocumented, for-Jim Meyering
testing-only option to start with `-', so that it cannot render ambiguous any prefix it happens to share with some other option name.
2005-11-01(parse_obsolete_option): Implement fix for "tail -c 2 FILE".Paul Eggert
2005-10-15(parse_options): Remove --allow-missing option.Jim Meyering
You can use --retry instead.
2005-09-16Include stat-time.h, and use its functions instead of the obsoletePaul Eggert
TIMESPEC_NS macro.
2005-08-22(xwrite_stdout): Rename from xwrite. Remove always-equal-to-STDOUT_FILENOJim Meyering
parameter and associated assertion. Adjust all callers.
2005-07-11(tail_bytes, tail_lines, tail_file, main):Paul Eggert
Avoid setmode; use POSIX-specified routines instead.
2005-07-03Include fcntl--.h, not unistd-safer.h.Paul Eggert
(recheck, tail_file): Don't call fd_safer; no longer needed now that we include fcntl--.h.
2005-06-16Don't embed `this'-style quotes in format strings.Jim Meyering
Rather than this: error (..., "...`%s'...", arg); do this: error (..., "...%s...", quote (arg));
2005-05-14Update FSF postal mail address.Jim Meyering
2005-05-14Update FSF postal mail address.Jim Meyering
2005-04-26(parse_obsolete_option): Don't complain about -NUM.Paul Eggert
2005-04-11Include unistd-safer.h rather than fcntl-safer.h.Paul Eggert
(recheck, tail_file): Use fd_safer rather than open_safer.
2005-03-28(follow_mode_string): Use NULL, not `0'.Jim Meyering
2005-01-14The test, tests/tail/f-1, failed on powerpc-apple-darwin7.7.0.Jim Meyering
(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.
2004-12-04(tail_file): Set errnum to -1 if the initial "tail" failed.Paul Eggert
2004-09-28(usage): Clarify: --retry works only with --follow=name.Jim Meyering
Reported by Nik A. Melchior in http://bugs.debian.org/273781.
2004-09-23(parse_obsolete_option): Bring back supportPaul Eggert
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.
2004-09-21Remove unused "case 0".Paul Eggert
2004-09-10(parse_obsolete_option): Renamed fromPaul Eggert
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.
2004-08-02(struct File_spec, reopen_inaccessible_files, count_lines,Paul Eggert
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.
2004-07-23Include fcntl-safer.h.Paul Eggert
(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.
2004-07-22(main): Ignore -f if no file operand is specifiedPaul Eggert
and standard input is a pipe.
2004-06-15(parse_obsolescent_option): Support multiple file operandsJim Meyering
even if POSIXLY_CORRECT, since POSIX does not require a diagnostic.
2004-05-06(main): Use xnmalloc, rather than xmalloc.Jim Meyering
2004-01-21(usage): Use EXIT_SUCCESS, not 0, for clarity.Jim Meyering
(usage): Don't bother normalizing exit status since the arg is already the correct exit status now.
2004-01-12(main): Warn about following stdin only when it's a tty.Jim Meyering
2004-01-04(main): Warn about following stdin.Jim Meyering
Fail when following by name but no names are specified.
2003-11-27Include "c-strtod.h".Jim Meyering
(parse_options): Update xstrtod call to include new argument, c_strtod.
2003-10-18Most .c files (AUTHORS): Revert the WRITTEN_BY/AUTHORS changeJim Meyering
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.
2003-10-16(start_bytes): Rename local, remainder, to avoidJim Meyering
gcc's warning about shadowing a global.
2003-09-18(WRITTEN_BY): Rename from AUTHORS.Jim Meyering
Begin each WRITTEN_BY string with `Written by ' and end it with `.'. Mark each WRITTEN_BY string as translatable.
2003-09-18revert previous changeJim Meyering
2003-09-18Update AUTHORS definition to be a comma-separated list of strings and/or updateJim Meyering
the call to parse_long_options so that `AUTHORS, NULL' are the last parameters.
2003-09-06(enum): Add ALLOW_MISSING_OPTION.Jim Meyering
(parse_options): Give a diagnostic for (but still accept) the deprecated --allow-missing option.
2003-09-05(pipe_lines, pipe_bytes): Don't assign 0 or SAFE_READ_ERROR to tmp->nbytes.Jim Meyering
(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.
2003-09-04(pipe_lines): Don't truncate return value from safe_read.Jim Meyering
2003-08-16(tail_lines): Fix a potential (but very hard to exercise)Jim Meyering
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).
2003-08-16An invalid initial value for *read_pos would result inJim Meyering
`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.
2003-08-09(main): Tweak Solaris OS version number in comment.Jim Meyering
2003-08-09(pipe_lines): Use memchr to skip lines, rather than an explicit loop.Jim Meyering
2003-08-09Add new undocumented option, --presume-input-pipe.Jim Meyering
2003-07-23Don't include headers already included by system.h:Jim Meyering
Don't include closeout.h.