summaryrefslogtreecommitdiffstats
path: root/usr.bin/tail
Commit message (Collapse)AuthorAgeFilesLines
* Back out revision 1.19 and 1.20 until I find mental clarity to deal witheivind2005-06-011-1/+7
| | | | issues bde pointed out.
* Remove an errno reset that became unnecessary.eivind2005-05-261-1/+0
| | | | Noticed by: juli
* We are past 4.4BSD - use our new-found stat flags for pipes and fifos.eivind2005-05-261-6/+1
|
* Don't skip the initialisation of tl->len when we hit an EOF immediatelyiedowse2005-03-201-3/+2
| | | | | | 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.
* Save last displayed file by having the "last" pointer global and save itdelphij2005-02-041-6/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* Added the EXIT STATUS section where appropriate.ru2005-01-171-1/+1
|
* Don't reprint file names unnecessarily.brian2005-01-121-4/+4
| | | | | | PR: 75028 Submitted by: mteterin at 250-217 dot customer dot cloud9 dot net MFC after: 7 days
* Bump WARNS to 4 as this seems OK on the alpha now.dwmalone2005-01-101-1/+1
|
* Cast size_t to off_t before adding them to avoid warnings on the alpha.dwmalone2005-01-102-4/+6
| | | | Use %ld and intmax_t for printing an off_t.
* Some variables became unused or global in the last change to thisdwmalone2005-01-101-9/+5
| | | | | | | file. Remove the now redundant declarations. Add declarations for the new show and set_events functions and make them static.
* Add support for following more than one file i.e.paul2004-11-043-96/+200
| | | | tail -f file1 file2
* Revert a WIP change that shouldn't have been in last commit.paul2004-11-031-4/+2
|
* Convert to ANSI style function definitions.paul2004-11-035-31/+12
|
* Mechanically kill hard sentence breaks.ru2004-07-021-1/+1
|
* Removed check of st_rdev changing in the -F support. st_rdev for regulardg2003-08-141-1/+0
| | | | | | | | | | | 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
* Revert part of the last commit. This fixes tail for pipes.markm2003-06-101-8/+7
| | | | Submitted by: joerg
* When doing tail -F, return if the freopen() of the file fails instead oftjr2002-12-151-0/+1
| | | | trying to use a null file pointer.
* revert WARNS=4, it makes the alpha compile sad.alfred2002-07-151-1/+1
|
* WARNS=4, addalfred2002-07-142-6/+5
|
* Note that this appeared at least as early as PWB UNIX.jmallett2002-06-101-2/+1
| | | | Use the literal string 'PWB UNIX', as we still have no .At macro for it.
* 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
OpenPOWER on IntegriCloud