aboutsummaryrefslogtreecommitdiff
path: root/usr.sbin/ac/ac.c
Commit message (Collapse)AuthorAgeFilesLines
* Add a check for wtmp records which have invalid values for ut_time. WtmpGarance A Drosehn2004-03-081-12/+64
| | | | | | | | | | | | | | | | | | records with time==0 get "the time of the last valid record", while records where time goes backwards (compared to the previous record) are skipped. Also prints a message saying how many records were changed or skipped due to these checks. Check was inspired by a simpler check in OpenBSD's version. This is all meant to sidestep problems that Tillman Hodgson noticed with 'ac' when running sparc64 with 64-bit time_t's. The real problem is whatever is creating wtmp records with ut_time==0, of course, but I have not yet figured out what is doing that. Reviewed by: no screams from freebsd-sparc64 or bde MFC after: 2 weeks Notes: svn path=/head/; revision=126752
* Add a debug-statement from NetBSD, and then rework all debug-statementsGarance A Drosehn2004-03-081-9/+82
| | | | | | | | | | | | | so the program compiles without errors or warnings when DEBUG is defined on sparc64 with 64-bit time_t's. Also have debug statements include the year when printing records from a different year than 'now'. Also print out a special timestamp in debug statements when ut_time==0. Reviewed by: freebsd-sparc, bde MFC after: 2 weeks Notes: svn path=/head/; revision=126750
* Minor style(9) fixes. remove a register keyword, correct two indents.Garance A Drosehn2004-03-031-3/+3
| | | | | | | Noticed while comparing to OpenBSD version. Notes: svn path=/head/; revision=126516
* Convert K&R-style routine definitions to C89 style, partially to reduceGarance A Drosehn2004-03-031-33/+13
| | | | | | | diffs with OpenBSD. This causes no changes to the object produced. Notes: svn path=/head/; revision=126515
* Remove unused #includes. Eliminate castings by using size_t instead of int.Philippe Charnier2002-10-171-8/+4
| | | | Notes: svn path=/head/; revision=105325
* Fix indentation broken in previous __P removal.Alfred Perlstein2002-07-111-14/+14
| | | | | | | Grumbled about by: bde Notes: svn path=/head/; revision=99831
* de-__P()Alfred Perlstein2002-07-111-13/+13
| | | | Notes: svn path=/head/; revision=99800
* Fixed some world breakage caused by not updating clients when <timeconv.h>Bruce Evans2002-07-081-0/+1
| | | | | | | | was split off from <time.h>. This became fatal here when -Werror was reenabled. Notes: svn path=/head/; revision=99604
* I've been meaning to do this for a while. Add an underscore to theMatthew Dillon2002-01-191-2/+2
| | | | | | | | | | | time_to_xxx() and xxx_to_time() functions. e.g. _time_to_xxx() instead of time_to_xxx(), to make it more obvious that these are stopgap functions & placemarkers and not meant to create a defacto standard. They will eventually be replaced when a real standard comes out of committee. Notes: svn path=/head/; revision=89572
* localtime() was being called with an int-pointer due to recent utmpMatthew Dillon2001-10-291-2/+4
| | | | | | | fixes. Notes: svn path=/head/; revision=85649
* Fix logic error resulting in incorrect calculation of login timeJonathan Chen2001-08-051-2/+2
| | | | | | | | | PR: bin/4204 Submitted by: Anatoly A. Orehovsky <tolik@www.tomsk.su> MFC after: 4 weeks Notes: svn path=/head/; revision=81156
* Replace strncpy -> strlcpyKris Kennaway2001-07-241-6/+3
| | | | | | | | Obtained from: OpenBSD MFC after: 1 week Notes: svn path=/head/; revision=80275
* Constify and set WARNS=2.Dima Dorfman2001-06-241-4/+4
| | | | | | | | Submitted by: Mike Barcroft <mike@q9media.com> Reviewed by: md5(1) Notes: svn path=/head/; revision=78713
* Use nl_langinfo instead of %EfAndrey A. Chernov2001-03-211-2/+7
| | | | Notes: svn path=/head/; revision=74568
* Use %Ef instead of hardcoded %b %eAndrey A. Chernov2000-06-221-1/+1
| | | | Notes: svn path=/head/; revision=61956
* err -> errx for malloc failurePhilippe Charnier1999-10-121-3/+3
| | | | Notes: svn path=/head/; revision=52166
* $Id$ -> $FreeBSD$Peter Wemm1999-08-281-1/+1
| | | | Notes: svn path=/head/; revision=50479
* Back out previous commit. Allowing `-' as a pseudonym for /dev/stdin isSheldon Hearn1999-07-021-14/+6
| | | | | | | | | legacy behaviour inherited from systems that don't have /dev/stdin. Requested by: bde Notes: svn path=/head/; revision=48459
* Allow the use of `-' as an argument to the -w option so that standardSheldon Hearn1999-06-301-6/+14
| | | | | | | | | | input may be used (e.g. gunzip -c /var/log/wtmp.Jan.gz | ac -w - ). PR: 12467 Submitted by: wollman Notes: svn path=/head/; revision=48378
* /var/log/wtmp entries for ptys are treated differently in ac, sincePoul-Henning Kamp1998-07-021-3/+3
| | | | | | | | | | | | they may not be logins. The code for determining whether it is a pty entry is broken. PR: 7137 Reviewed by: phk Submitted by: Tom Rush <tarush@mindspring.com> Notes: svn path=/head/; revision=37330
* Give correct times with old wtmp files.Steve Price1998-05-251-2/+3
| | | | | | | | PR: 4732 Submitted by: Andrew Timonin <tim@pool1.convey.ru> Notes: svn path=/head/; revision=36353
* Style in rcsid, sort #include.Philippe Charnier1997-09-011-4/+5
| | | | Notes: svn path=/head/; revision=28995
* compare return value from getopt against -1 rather than EOF, per the finalWarner Losh1997-03-311-2/+2
| | | | | | | posix standard on the topic. Notes: svn path=/head/; revision=24428
* Revert $FreeBSD$ to $Id$Peter Wemm1997-02-221-1/+1
| | | | Notes: svn path=/head/; revision=22997
* Make the long-awaited change from $Id$ to $FreeBSD$Jordan K. Hubbard1997-01-141-1/+1
| | | | | | | | | | | This will make a number of things easier in the future, as well as (finally!) avoiding the Id-smashing problem which has plagued developers for so long. Boy, I'm glad we're not using sup anymore. This update would have been insane otherwise. Notes: svn path=/head/; revision=21673
* Add setlocale LC_TIMEAndrey A. Chernov1995-10-261-1/+4
| | | | Notes: svn path=/head/; revision=11827
* Remove trailing whitespace.Rodney W. Grimes1995-05-301-19/+19
| | | | Notes: svn path=/head/; revision=8857
* strncmp use wrong utmp name sizeAndrey A. Chernov1994-11-141-2/+2
| | | | | | | Submitted by: rlz@zeus.id.net Notes: svn path=/head/; revision=4484
* ac(8) utility, brought over from FreeBSD 1.1.5.David Greenman1994-09-261-0/+557
Notes: svn path=/head/; revision=3133