| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
| |
Put a sequence point between writing to a variable and using it.
|
|
|
|
| |
statement.
|
| |
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
renames/rotations) only detected cases where the file itself was
moved or deleted. If part of the path to the file (or a symlink
in the path) was changed instead, tail would not notice.
Fix this by ensuring that we stat the path at least once every
second in the -F case to check for changes. We still use kqueue
when possible to inform us quickly when the file has changed.
PR: bin/24955
Submitted by: Maxim Konovalov <maxim@macomnet.ru>
MFC after: 1 week
|
|
|
|
|
|
| |
with -F, e.g. tail -1 -F /var/log/messages.
Submitted by: Maxim Konovalov <maxim@macomnet.ru>
|
|
|
|
|
|
|
|
|
|
|
| |
long -> off_t
strtol -> strtoll
fseek -> fseeko
NOTE: that fseek not works for >long offsets files per POSIX:
[EOVERFLOW] For fseek( ), the resulting file offset would be a value which
cannot be represented correctly in an object of type long.
|
| |
|
| |
|
|
|
|
|
| |
resume using kqueue to monitor it, if possible.
o auto-clear the read filter on EOF; this is needed when tailing a FIFO.
|
|
|
|
| |
displayed last, not to the end of file
|
|
|
|
|
|
| |
fseeko(file_size, SEEK_SET) -> fseek(0L, SEEK_END)
1) File may grows between operations, so fseeko to file_size may miss
2) 0L, SEEK_END is the same code using in tail in all other places
|
|
|
|
|
| |
PR: 14786
Reviewed by: iedowse
|
|
|
|
|
|
| |
on its check.
KNF multi-line comments
(inspired by bde)
|
|
|
|
| |
Better explanation comment of FIXME section
|
| |
|
|
|
|
|
|
|
|
|
|
|
| |
1) really check for size overflow by checking negative value.
2) since mmap() not support files over INT_MAX size, add check for it
until either mmap() will be fixed or tail will be rewritted to handle
large files alternatively.
3) replace fseek(... file_size, SEEK_SET) with fseek(... 0L, SEEK_END)
to avoid off_t -> long cast
4) Use exit() if file is too big instead of warning and wrong logic
afterwards.
|
| |
|
|
|
|
|
| |
PR: 24586
Submitted by: Cyrille Lefevre <clefevre@citeweb.net>
|
|
|
|
|
| |
Modern compilers are smarter when it comes to allocating register
usage.
|
| |
|
|
|
|
| |
Also #if out some sccsid's and add rcsid's.
|
| |
|
| |
|
|
|
|
|
|
|
|
|
|
| |
filesystem not being kq-aware), then fall back to using sleep. This
allows tail to work with NFS filesystems again without chewing up CPU time.
When given the -F flag, resort to sleep/stat after the file was moved
or deleted. This allows a window where the file being tailed does not
exist at all, which is typically the case during log rotation. Switch
back to using kq (if possible) after the file is reopened.
|
| |
|
|
|
|
| |
the file changes (when doing tail -{f|F}).
|
| |
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
track.
The $Id$ line is normally at the bottom of the main comment block in the
man page, separated from the rest of the manpage by an empty comment,
like so;
.\" $Id$
.\"
If the immediately preceding comment is a @(#) format ID marker than the
the $Id$ will line up underneath it with no intervening blank lines.
Otherwise, an additional blank line is inserted.
Approved by: bde
|
| |
|
| |
|
|
|
|
|
|
| |
stat() the file being followed and do a close/reopen if the file has been
renamed and/or rotated. This is damn useful for leaving running on files
in /var/log when newsyslog(8) rotates them.
|
| |
|
|
|
|
| |
Pointed out by by: bde
|
|
|
|
| |
Submitted by: Mikael Karpberg <karpen@ocean.campus.luth.se>
|
|
|
|
| |
Let's try 250ms.
|
| |
|
|
|
|
| |
posix standard on the topic.
|
|
|
|
|
|
|
|
|
|
|
|
| |
- Use MAP_FAILED instead of the constant -1 to indicate
failure (required by POSIX).
- Removed flag arguments of '0' (required by POSIX).
- Fixed code which expected an error return of 0.
- Fixed code which thought any address with the high bit set
was an error.
- Check for failure where no checks were present.
Discussed with: bde
|
| |
|
| |
|
|
|
|
|
| |
which was slightly different to the libc one. To save any more cunfusion,
use the libc one.
|
|
|
|
|
|
|
|
| |
- timeval in select loop was depending on not having the remaining time
returned from select(), causing a busy spin on an implementation that
does implement it.
- the err() usage was pretty bogus, some of the error messages had
strerror attached manually and then reattached by err().
|
|
|
|
| |
tidy up
|
|
|
|
|
|
|
| |
fail once (was twice) in forward case
fail once (was no times) in reverse case
this can happen when file is a directory on an NFS or procfs mount.
|
|
|
|
| |
Submitted by: Kai Vorma <vode@snakemail.hut.fi>
|
|
|