summaryrefslogtreecommitdiffstats
path: root/usr.bin/tail
Commit message (Collapse)AuthorAgeFilesLines
* Fix up vendor IDs.dwmalone2002-04-131-7/+10
| | | | Put a sequence point between writing to a variable and using it.
* GCC 3.1 cleanup - add a break after default: at the end of a switchmurray2002-04-082-0/+2
| | | | statement.
* remove __Pimp2002-03-224-13/+13
|
* WARNS=2 fixes, use __FBSDID().markm2001-12-126-67/+78
|
* Since kqueue support was added to tail, the "-F" option (check foriedowse2001-11-251-30/+34
| | | | | | | | | | | | | | 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
* Allow "obsolete" (but commonly-used) command line style to be usedfenner2001-10-021-2/+3
| | | | | | with -F, e.g. tail -1 -F /var/log/messages. Submitted by: Maxim Konovalov <maxim@macomnet.ru>
* File positions are off_t nowdays, not long, so:ache2001-09-014-14/+14
| | | | | | | | | | | 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.
* mdoc(7) police: utilize the new .Ex macro.ru2001-08-151-3/+1
|
* mdoc(7) police: removed HISTORY info from the .Os call.ru2001-07-101-1/+1
|
* o If the file being tailed is moved back to the original location,jlemon2001-06-061-1/+3
| | | | | resume using kqueue to monitor it, if possible. o auto-clear the read filter on EOF; this is needed when tailing a FIFO.
* Back out my fseeko -> fseek(END) change - we need to position on what weache2001-03-281-1/+1
| | | | displayed last, not to the end of file
* Restore part of my fix spammed in v1.23:ache2001-03-271-1/+1
| | | | | | 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
* Fix tail to work on files bigger than 2GB.dwmalone2001-03-274-65/+146
| | | | | PR: 14786 Reviewed by: iedowse
* Add comment explaining why size not passed directly to mmap, i.e. not relayache2001-03-271-3/+9
| | | | | | on its check. KNF multi-line comments (inspired by bde)
* Use SSIZE_MAX instead of INT_MAX, as kernel does ssize_t checkache2001-03-271-1/+3
| | | | Better explanation comment of FIXME section
* Treat mmap() error as fatal too, i.e. do exit(1) instead of returnache2001-03-261-1/+1
|
* rlines() checks:ache2001-03-261-3/+10
| | | | | | | | | | | 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.
* Use EV_SET() macro to initialize kevent structure.jlemon2001-02-281-7/+5
|
* Mention the -F in the usage().ru2001-01-241-1/+1
| | | | | PR: 24586 Submitted by: Cyrille Lefevre <clefevre@citeweb.net>
* Remove register keyword usage with prejudice.asmodai2000-12-034-16/+16
| | | | | Modern compilers are smarter when it comes to allocating register usage.
* Use a size_t instead of an int.asmodai2000-12-021-1/+1
|
* Properly constify some static arrays.asmodai2000-12-024-3/+17
| | | | Also #if out some sccsid's and add rcsid's.
* mdoc(7) police: use the new features of the Nm macro.ru2000-11-201-1/+1
|
* Convert calls to match new kqueue API.jlemon2000-07-181-5/+2
|
* If the kevent() registration fails (probably due to the underlyingjlemon2000-06-221-19/+53
| | | | | | | | | | 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.
* Change <event.h> --> <sys/event.h>jlemon2000-04-181-1/+1
|
* Change tail to use kqueue/kevent to obtain a notification whenjlemon2000-04-161-22/+51
| | | | the file changes (when doing tail -{f|F}).
* Add DIAGNOSTICS section namecharnier2000-03-261-1/+1
|
* $Id$ -> $FreeBSD$peter1999-08-282-2/+2
|
* Add $Id$, to make it simpler for members of the translation teams tonik1999-07-121-0/+1
| | | | | | | | | | | | | | | | | 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
* Clean up some ambiguous nested if/elses.billf1999-07-041-1/+2
|
* Fixed printf format errors.bde1998-07-061-2/+2
|
* Add a new -F flag which is a superset of -f. It will cause tail topeter1998-04-064-4/+42
| | | | | | 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.
* Change select(0, NULL, ...) to usleep()ache1997-12-121-5/+1
|
* Fix a misleading comment. Rename a variable to make more sense.phk1997-10-111-5/+4
| | | | Pointed out by by: bde
* Fix a comment.phk1997-09-151-1/+1
| | | | Submitted by: Mikael Karpberg <karpen@ocean.campus.luth.se>
* In these days, waiting one full second for more to appear is far too long.phk1997-09-141-2/+2
| | | | Let's try 250ms.
* Remove trailing \n in warn() string.charnier1997-08-132-10/+15
|
* compare return value from getopt against -1 rather than EOF, per the finalimp1997-03-291-1/+1
| | | | posix standard on the topic.
* Sweep through the tree fixing mmap() usage:alex1997-01-162-2/+2
| | | | | | | | | | | | - 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
* complete err() changes, actually use warn() in most instancesadam1996-08-263-9/+9
|
* Dont forget to #include <err.h>peter1996-08-255-0/+5
|
* Argh! caught! *blush*.. This program was supplying it's own 'err' routinepeter1996-08-255-46/+15
| | | | | which was slightly different to the libc one. To save any more cunfusion, use the libc one.
* Fix some bogons:peter1996-08-251-11/+10
| | | | | | | | - 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().
* one file somehow slipped by me in the previous commitadam1996-07-302-2/+6
| | | | tidy up
* when file can be opened for read but cannot be read from:adam1996-07-303-6/+11
| | | | | | | 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.
* Another program depending on zero'ed malloc.phk1995-10-101-1/+1
| | | | Submitted by: Kai Vorma <vode@snakemail.hut.fi>
* BSD 4.4 Lite Usr.bin Sourcesrgrimes1994-05-278-0/+1308
OpenPOWER on IntegriCloud