summaryrefslogtreecommitdiff
AgeCommit message (Collapse)Author
2004-07-23Fix bug with tail -f and pipes, plus a few other problems with tail.Paul Eggert
2004-07-23Add fcntl-safer.Paul Eggert
2004-07-23(gl_PREREQ): Add gl_FCNTL_SAFER.Paul Eggert
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-23(libfetish_a_SOURCES): Add fcntl-safer.h, open-safer.c.Paul Eggert
2004-07-23New file.Paul Eggert
2004-07-23(tail invocation): "size has remained the same"Paul Eggert
-> "file has not changed", which is more accurate for fifos.
2004-07-23tail: Fix bug with -f and pipes; remove --max-consecutive-size-changes.Paul Eggert
2004-07-22Regenerate.Paul Eggert
2004-07-22Add fix for "tail -f" when stdin is a pipe.Paul Eggert
2004-07-22Reinstate f-1 test, since we now pass.Paul Eggert
Add a new commented-out f-2 test, which we still fail. (test_vector): All f-* tests are special cases, not just f-1.
2004-07-22(tail invocation): Do not ignore -f forPaul Eggert
all pipes, just for when standard input is a pipe and no file operand is specified.
2004-07-22(main): Ignore -f if no file operand is specifiedPaul Eggert
and standard input is a pipe.
2004-07-13Prefer c_strtod to setlocale when scanning floating point.Paul Eggert
2004-07-12Include <errno.h>, <stdio.h>, <stdlib.h> evenPaul Eggert
if HAVE_GETLOADAVG is defined, so that the test program can work. (errno): Remove declaration; not needed in C89 or later. Include "c-strtod.h". Do not include locale.h or define setlocale; no longer needed. Include <limits.h>. (INT_STRLEN_BOUND): New macro. (getloadavg): Use it to compute buffer size. Don't assume that buffer will be properly terminated by 'read'. Use c_strtod instead of setlocale. (main) [defined TEST]: Return int, not void.
2004-07-12Include c-strtod.h.Paul Eggert
(print_uptime): Use c_strtod instead of setlocale and sscanf. Use long int rather than int to count days (for 64-bit hosts), and check for arithmetic overflow when converting double to time_t.
2004-07-12(gl_C_STRTOD): Add gl_USE_SYSTEM_EXTENSIONS.Paul Eggert
2004-07-12(STRTOD_L): New macro.Paul Eggert
(C_STRTOD) [defined LC_ALL_MASK]: Use it, so that the code is reentrant on platforms that have strtod_l.
2004-07-12Regenerate.Paul Eggert
2004-07-12Regenerate.Paul Eggert
2004-07-12printf now uses long double.Paul Eggert
2004-07-12New file.Paul Eggert
2004-07-12(vstrtold): Renamed from vstrtod.Paul Eggert
Now returns long double. All uses changed. (print_direc): Use "L" length modifier when printing floating point numbers, since we're now printing long double.
2004-07-12(gl_PREREQ): Add gl_C_STRTOLD.Paul Eggert
2004-07-12New file.Paul Eggert
2004-07-12(c_strtold): New decl.Paul Eggert
2004-07-12Include <config.h> first.Paul Eggert
(C_STRTOD, DOUBLE, STRTOD): New macros. (c_strtod): Use them.
2004-07-12(libfetish_a_SOURCES): Add c-strtold.c.Paul Eggert
2004-07-08.Jim Meyering
2004-07-08*** empty log message ***Jim Meyering
2004-07-08printf cleanup, to avoid undefined behavior, to add support forJim Meyering
formats that Bash supports, and to support wide integers like Bash does. Add tests for the above.
2004-07-08*** empty log message ***Jim Meyering
2004-07-08printf cleanup, to avoid undefined behavior, to add support forJim Meyering
formats that Bash supports, and to support wide integers like Bash does. (UNSPECIFIED): Remove. All uses now replaced by booleans, so that we don't reserve any values for precision or width (like Bash). (STRTOX): Use prototype, not K&R-style definition. (vstrtoimax): Renamed from xstrtol (to avoid confusion with xstrtol in ../lib), with type change to intmax_t. All uses changed. (vstrtoumax): Renamed from xstrtoul, with type change to uintmax_t. All uses changed. (vstrtod): Renamed from xstrtod. All uses changed. (print_direc): Use boolean arg instead of special value to indicate a missing precision or width. LENGTH no longer includes length modifiers or conversion character. New arg CONVERSION now specifies conversion character. Use intmax_t-width formatting for integers (like Bash). Add support for C99 %a, %A, %F (like Bash). Add support for field width with %c (POSIX requires this). Add a FIXME for lack of support for field width and precision for %b. Add support for '\'', '0' flags. Check for invalid combinations of flags, field width, precision, and conversion, to prevent use of undefined behavior. Allow multiple length modifiers, for formats like "%lld" (like Bash). Add support for C99 'j', 't', 'z' length modifiers (like Bash). In error message, output entire invalid conversion specification, instead of merely outputting % followed by the conversion char.
2004-07-07*** empty log message ***Jim Meyering
2004-07-07Don't infloop when MAXSYMLINKS is not defined.Jim Meyering
Detect symlink loops much earlier (albeit lazily) on systems with MAXSYMLINKS defined to a large value. Include "cycle-check.h". (canonicalize_filename_mode): Don't try to detect loops by counting symlink-hops. Instead, use the cycle-check module.
2004-07-07Include stdbool.h.Jim Meyering
Forward-declare `struct stat'.
2004-07-07*** empty log message ***Jim Meyering
2004-07-07(canonicalize_filename_mode): Remove do-while(0) loop.Jim Meyering
Replace each corresponding `break' stmt with `continue'.
2004-07-06.Jim Meyering
2004-07-06.Jim Meyering
2004-07-06Include "stat-macros.h".Jim Meyering
(canonicalize_filename_mode): Remove #ifdef S_ISLNK, now that S_ISLNK is guaranteed to be defined (via stat-macros.h).
2004-07-06*** empty log message ***Jim Meyering
2004-07-06(libfetish_a_SOURCES): Add canonicalize.c unconditionally.Jim Meyering
2004-07-06(canonicalize_mode_t): New type.Jim Meyering
2004-07-06Include "file-type.h".Jim Meyering
(canonicalize_filename_mode): New function, based on canonicalize_file_name, supports three canonicalize modes. (canonicalize_file_name) [!HAVE_CANONICALIZE_FILE_NAME && !HAVE_RESOLVEPATH]: Use it.
2004-07-06*** empty log message ***Jim Meyering
2004-07-06(AC_FUNC_CANONICALIZE_FILE_NAME): Do not add canonicalize.c here.Jim Meyering
2004-07-06*** empty log message ***Jim Meyering
2004-07-06(readlink invocation): Document newJim Meyering
"readlink -f" behaviour and new canonicalize options, -e and -m.
2004-07-06.Jim Meyering