Jim Meyering [Fri, 30 Jul 1999 20:42:39 +0000 (20:42 +0000)]
New option: --pid=PID.
(pid): New global.
(long_options): Add `pid'.
(usage): Describe it.
(tail_forever): Implement it.
(parse_options): Handle the new option and required arg.
Suggestion and pseudo-code from Karl Heuer.
Jim Meyering [Tue, 20 Jul 1999 07:56:59 +0000 (07:56 +0000)]
(posixly_correct): Declare global.
(write_counts): Use it to select printf formats.
(main): Set posixly_correct from the POSIXLY_CORRECT envvar.
From Peter Moulder.
Jim Meyering [Sat, 10 Jul 1999 12:24:10 +0000 (12:24 +0000)]
(struct File_spec) [tailable]: Rename from `missing' and
document. Change all uses and locals like was_missing to was_tailable.
Invert expressions as appropriate.
(reopen_inaccessible_files): Rename from allow_missing.
(sleep_interval): Describe.
(--allow-missing): Deprecate.
(--retry): New option, equivalent to --allow-missing.
(usage): Document name vs. descriptor differences.
Refer to manual for descriptions of --max-unchanged-stats=N
and --max-consecutive-size-changes=N.
(valid_file_spec): New function.
(recheck): Assert valid_file_spec.
Remove dead else-if block (suggestion from Eli Zaretskii).
Adjust stmts that set f->tailable -- unlike for `missing', tailable
doesn't depend on errno == ENOENT.
(parse_options): Give a warning if --retry is used when not following
by name.
Jim Meyering [Sat, 10 Jul 1999 09:56:37 +0000 (09:56 +0000)]
(struct File_spec): New member, errnum.
(recheck): Record the new value of errno in f->errnum. Don't
output an error message unless the new value of errno differs from
the old one. Output a message if previously-inaccessible file
becomes accessible.
(tail_forever): Always recheck files whose fd is negative. If the
file cannot be fstat'ed, record the errno value in f[i].errnum.
(tail_file): If the file cannot be open, record the errno value in
f->errnum. If it can be opened, initialize f->errnum to zero. If
it's a non-regular non-fifo file, initialize f->errnum to -1.
Jim Meyering [Sun, 4 Jul 1999 10:28:08 +0000 (10:28 +0000)]
Add support for LC_COLLATE locale.
Include hard-locale.h, linebuffer.h, memcoll.h.
(struct line): New member `buf', replacing `beg' and `lim'.
All uses changed.
(hard_LC_COLLATE): New var.
(main): Initialize it.
(get_line): Use readline to read the line,
instead of doing it by hand.
That way, we get a buffer that we can pass to memcoll.
(keycmp): Use memcoll to compare lines if hard_LC_COLLATE is nonzero.
Jim Meyering [Sun, 4 Jul 1999 10:23:19 +0000 (10:23 +0000)]
Include hard-locale.h, memcoll.h.
(hard_LC_COLLATE, hard_LC_CTYPE, hard_LC_TIME): New variables,
replacing `need_locale'.
(memcoll): Move to lib/memcoll.c.
(keycompare): No need to alloc (0), since our caller now does it.
(compare): alloca (0) before returning.
(my_setlocale): Remove; hard_locale now dows this.
(main): Invoke setlocale, bindtextdomain, and textdomain before
invoking anything that might print an error.
Use hard_locale to determine which locales are hard.
Jim Meyering [Sun, 4 Jul 1999 10:22:25 +0000 (10:22 +0000)]
Include hard-locale.h, memcoll.h.
(hard_LC_COLLATE): New variable.
(compare_files): Use memcoll to compare if hard_LC_COLLATE.
(main): Initialize hard_LC_COLLATE from locale.
Jim Meyering [Sun, 4 Jul 1999 10:14:03 +0000 (10:14 +0000)]
(find_field, different): Use size_t, not int, for lengths.
(writeline): Lines now contain trailing newline.
(check_file): Use size_t, not int, for lengths.