reed
42346787b7
Change or add history. I checked the 1bsd archives and this first
...
appeared in 1BSD (before it was known as 1BSD). I looked at code and
later sccs history to confirm. In the case of rewritten code, we are
not consistent in manpages indicating that history.
2012-05-12 14:52:57 +00:00
dholland
d4bd1c2d11
Tidy up: we no longer need FIRSTVALID for its original purpose, so change
...
the name of the symbol to something that applies to the remaining use.
2012-03-15 03:04:05 +00:00
dholland
6eb9e0a428
When the wtmp file is empty, for the "wtmp[x] begins..." output, use
...
the last mod time of the wtmp file (in practice, the time it was last
rotated, which is when it begins) instead of the current time, which
wasn't ever particularly useful. PR 39444.
2012-03-15 03:01:03 +00:00
dholland
ce683a0035
Keep track of the timestamp of the last (thus oldest) record seen and use
...
it to print "wtmp[x] begins" at the end, instead of knowing where to look
in the final utmp buffer to get a final timestamp out. This is both tidier
and fixes a problem with wtmpx files, which is that if the header record
is missing (which it seems to be on my machines) it would fetch the wrong
time out, and if you happened to have a one-record wtmp file it would use
the current time instead. This change restores the traditional behavior
of printing the time of the oldest record in the file, and if no records
are present to use the current time.
It might be a bug that wtmpx files don't seem to have the header
record they supposedly ought to.
2012-03-15 02:55:02 +00:00
reed
08dba12376
patch from from Snader_LB via IRC.
...
- mention "The following options are available:"
- improve grammar
- provide useful tip about -x
2011-10-19 00:27:40 +00:00
joerg
6818646ac8
Use __dead
2011-09-16 15:39:25 +00:00
dholland
2480682bb2
Avoid SIGSEGV on out-of-range time_t.
2010-06-05 03:24:01 +00:00
lukem
fff2866fd3
Fix WARNS=4 issues (-Wshadow -Wcast-qual -Wsign-compare)
2009-04-12 13:07:21 +00:00
christos
7d9f37ceba
fix time format.
2008-12-29 01:25:04 +00:00
lukem
98e5374ccb
Remove the \n and tabs from the __COPYRIGHT() strings.
...
Tweak to use a consistent format.
2008-07-21 14:19:20 +00:00
lukem
5d427989ff
Convert to raise_default_signal(3).
2007-10-05 07:27:41 +00:00
reed
cd2b62d931
Add lastlogin(8) to see also.
2007-07-27 16:59:25 +00:00
cbiere
0086d50320
Respect the environment variable TMPDIR if set.
2007-01-06 14:29:44 +00:00
cbiere
4b96ead963
Pointing before a memory object is not proper C. Use an index instead of
...
pointer arithmetic.
2007-01-06 14:11:20 +00:00
cbiere
a8d0a33445
- Applied patch by David Holland from PR bin/35354.
...
- Use EXIT_SUCCESS/EXIT_FAILURE instead of 0/1.
- Additional check for regular file.
- Use pread() instead of lseek() + read().
- Check for partial read to prevent out-of-bounds memory access.
- Added FIXME to onintr(): This is no proper signal handler albeit might
not really matter here.
2007-01-06 14:00:36 +00:00
cbiere
2fe9526c5d
- Use EXIT_SUCCESS/EXIT_FAILURE instead of 0/1.
...
- Reject unreasonable command-line arguments.
- No need to cast sizeof() to u_int for malloc().
- ttyconv: Simplified and replaced magic '5'.
2007-01-06 13:31:06 +00:00
pooka
a61b6925e7
support reading wtmp/wtmpx from stdin with -f -
...
from bin/35329 by David A. Holland
2006-12-27 18:03:26 +00:00
ginsbach
62221c2759
Code indentation fix up.
2006-02-28 17:17:43 +00:00
christos
2309deb39e
restructure as a single level if/then/elif/else
2006-01-22 15:47:10 +00:00
martin
f6234a13ab
Do not access out of bounds argv when mixing non-getopt -<digit> arguments
...
with regular getopt-handled options.
Fixes PR bin/32596.
2006-01-22 15:24:38 +00:00
christos
8f166961b9
Remove extra ; found by gcc-2.95 and reported in port-vax.
2005-03-14 13:34:57 +00:00
wiz
35a9dd4fdd
Remove trailing whitespace, and use .Sq instead of manual quoting.
2005-03-05 14:28:31 +00:00
christos
5c543845da
PR/26934: Curt Sampson: Add -x flag to process wtmpx files that don't end
...
in `x'.
2005-03-04 17:16:13 +00:00
christos
add06817f7
PR/23409: Geoff C. Wing: make sure we only print nul terminated strings.
2005-03-04 17:11:19 +00:00
christos
ccd2e5bea8
use sockaddr_snprintf()
2004-11-19 21:41:25 +00:00
wiz
4050e4b376
Add -n to usage.
2004-11-11 01:01:22 +00:00
wiz
c62efc1052
Options without arguments are combined in SYNOPSIS; new sentence, new line.
2004-11-11 01:00:34 +00:00
christos
8583098c75
Add -n flag to print numeric entries.
2004-11-11 00:54:23 +00:00
jmmv
b635f565e7
Homogenize usage messages: make the 'usage' word all lowercase, as this seems
...
to be the most common practice in our tree.
2004-01-05 23:23:32 +00:00
agc
89aaa1bb64
Move UCB-licensed code from 4-clause to 3-clause licence.
...
Patches provided by Joel Baker in PR 22365, verified by myself.
2003-08-07 11:13:06 +00:00
itojun
ab3a8ded53
use bounded string op/asprintf
2003-07-14 12:02:00 +00:00
wiz
31b27aaae4
Fix typo in error message.
2003-07-07 11:42:13 +00:00
wiz
2bc4fd781d
Sync usage with options; sort option string; handle N instead of
...
non-existing U option.
2003-03-03 07:18:37 +00:00
wiz
5f20c96d59
Bump date. Sort options, sort SEE ALSO.
2003-03-03 07:17:35 +00:00
matt
1800f61318
#undef TYPE(a) is not legal. Change to #undef TYPE /*(a)*/
2003-02-28 05:49:42 +00:00
christos
8475773db1
Add wtmpx support.
2003-02-17 15:08:57 +00:00
grant
be8ae688ae
New sentence, new line.
2002-09-30 11:08:56 +00:00
simonb
28ef2fe1b7
Include -T in the synopsis.
2001-08-21 23:55:25 +00:00
simonb
a04cd254e0
Fix botch in previous - include the day of the month in the output!
...
Noticed by Geoff Wing.
2000-06-30 06:19:58 +00:00
simonb
40ca17538d
Extend the -T option show that it shows the year as well as seconds.
...
Also print the full time on interrupt and exit, regardless of the
-T setting. Replace all uses of asctime()/ctime() and magic number
offsets within their return strings with strftime().
Fixes PR bin/5311 from Geoff Wing and much more.
2000-06-25 13:44:42 +00:00
simonb
d88dfea295
Don't declare 'extern opt*' getopt variables.
2000-04-14 06:11:07 +00:00
garbled
9e44e9b578
More and more .Os cleanups. .Os is defined in the tmac.doc-common file,
...
so we shouldn't override it with versions in the manpages. Many more to
come.
1999-03-22 18:16:34 +00:00
christos
6e0fa105be
Avoid bogus warnings produced by gcc-2.8.1 where it wants field widths to be
...
ints and copmplains if they are unsigned ints!
1998-12-19 17:38:39 +00:00
ross
f670fa10c5
Add { and } to shut up egcs. Reformat the more questionable code.
1998-08-25 20:59:36 +00:00
mrg
2beab49a06
- use an array MAXHOSTNAMELEN+1 size to hold hostnames
...
- ensure hostname from gethostname() is nul-terminated in all cases
- minor KNF
- use MAXHOSTNAMELEN over various other values/defines
- be safe will buffers that hold hostnames
1998-07-06 06:45:41 +00:00
lukem
511567046a
fix up .Nm usage
1997-10-19 03:44:30 +00:00
lukem
ca15d8c056
don't define WARNS=1 here
1997-10-19 03:44:21 +00:00
thorpej
a436ba4f68
Change an instance of a time_t to a (more appropriate) off_t, PR #4037 ,
...
enami tsugutomo.
1997-08-26 18:52:13 +00:00
kleink
e021da65e2
* Fix compiler warnings
...
* Style: lseek(2) L_SET vs. SEEK_SET; getopt(3) EOF vs. -1
1997-08-24 13:57:54 +00:00
perry
c0274208c2
add -T option to display seconds, from jhawk in pr-1548
1997-07-17 02:36:55 +00:00