| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
|
|
|
|
|
|
|
| |
This should fix the double free() bug where there's no tailing newline(\n)
character:
current# echo -n test | tail
testAssertion failed: (run->magic == ARENA_RUN_MAGIC), function
arena_dalloc, file /usr/src/lib/libc/stdlib/malloc.c, line 2448.
Abort (core dumped)
Reviewed by: kib
MFC after: 3 days
|
| |
|
|
|
|
|
|
| |
Submitted by: rdivacky
Obtained from: OpenBSD
MFC after: 1 week
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
o When stat(2) fails (i.e. the file has been moved) there's no new
file with the same name yet, so keep showing the file that's open.
This yields the same behaviour as -f, for which we don't stat(2).
o When a new file with the same name has been created (i.e stat(2)
succeeds but the inode or device numbers differ from the opened
file), show any new lines in the opened file (i.e. the old or
rotated file) before reopening the new file.
These changes fix the observed behaviour that tail(1) doesn't show
the very last lines of the rotated (log) files.
PR: bin/101979
Tested by: Jos Backus <jos@catnook.com>
MFC after: 2 months
|
|
|
|
| |
- Add the forgotten new option in usage().
|
|
|
|
|
| |
Approved by: cperciva (mentor)
MFC after: 1 week
|
| |
|
|
|
|
| |
issues bde pointed out.
|
|
|
|
| |
Noticed by: juli
|
| |
|
|
|
|
|
|
| |
after allocating a new buffer. This bug caused `tail -r < /dev/null'
to core dump when the `J' malloc option is set, and also affected
any other input that was an exact multiple of 128k.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
during we show the first file's tail. Instead of:
tarsier% tail -f 1 2
==> 1 <==
foo
bar
==> 2 <==
bar
foo
==> 2 <==
bar2
foo2
Now with this change, we have:
tarsier% tail -f 1 2
==> 1 <==
foo
bar
==> 2 <==
bar
foo
bar2
foo2
While I'm there, move a comment to where it should belong to. Also,
const'ify the "last" static because we will never need to change the
contents it points to.
MFC After: 1 week
|
| |
|
|
|
|
|
|
| |
PR: 75028
Submitted by: mteterin at 250-217 dot customer dot cloud9 dot net
MFC after: 7 days
|
| |
|
|
|
|
| |
Use %ld and intmax_t for printing an off_t.
|
|
|
|
|
|
|
| |
file. Remove the now redundant declarations.
Add declarations for the new show and set_events functions and make
them static.
|
|
|
|
| |
tail -f file1 file2
|
| |
|
| |
|
| |
|
|
|
|
|
|
|
|
|
|
|
| |
files is usually the first direct block pointer. Since FreeBSD does
automatic block reallocation to reduce filesystem fragmentation, the
file being tailed can be relocated to different blocks 'on-the-fly',
making the check for st_rdev unreliable. The result of this bug is
tail -F pseudo-randomnly thinking the file was rotated when it wasn't,
and as a result, spews out the entire file trying to catch up.
MFC after: 3 days
|
|
|
|
| |
Submitted by: joerg
|
|
|
|
| |
trying to use a null file pointer.
|
| |
|
| |
|
|
|
|
| |
Use the literal string 'PWB UNIX', as we still have no .At macro for it.
|
|
|
|
| |
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.
|