Commit Graph

41 Commits

Author SHA1 Message Date
kre d4305dc776 sysctl(KERN_BOPOTIME) started returning a struct timespec in 2009.
Update to match....    We're slow but we get there eventually!

NFC for any of these programs, struct timeval and struct timespec
are the same size, and only the tv_sec field of boottime is used,
and that's unchanged.
2018-10-30 21:15:09 +00:00
christos a226200999 include <pwd.h> 2012-11-04 22:32:01 +00:00
joerg bec77c5f43 Use __dead 2011-08-31 13:32:36 +00:00
lukem e3823f584e Fix -Wsign-compare issue 2009-04-18 13:05:54 +00:00
lukem 9c1945664c Remove the \n and tabs from the __COPYRIGHT() strings.
Tweak to use a consistent format.
2008-07-21 13:36:57 +00:00
dholland 16e3bec279 Clarify how one is supposed to use the pointers returned by getutentries()
(the utmpentry.c code), specifically with respect to who owns them and
when to free them. Now they're owned by utmpentry.c, only. Abolish the
freeutentries() function, which was the wrong abstraction; add instead
endutentries(), which flushes out the internally managed memory.

Update callers as necessary. Some (e.g. talkd) had been leaking memory;
others (e.g. syslogd) had been accidentally freeing and reloading utmp
more often than necessary. There are a couple untidy bits in users and
rwhod that someone should look after sometime, maybe.

Fixes PR bin/35131, which was about talkd's memory leak.
2008-07-13 20:07:48 +00:00
perry 8b0f9554ff convert __attribute__s to applicable cdefs.h macros 2007-12-15 19:44:37 +00:00
mrg c48f394145 assign to wd.wd_recvtime rather than casting a pointer to it
to a time_t pointer to call time(3).
2006-05-11 08:40:28 +00:00
christos 18b5fc9e5c Off by one in copying stuff to struct whoent. Found by Liam Foy. 2005-10-02 16:49:46 +00:00
wiz 6438e0bfa7 Sync usage with man page. 2005-09-12 18:34:37 +00:00
tsarna 04414a373b Add -u option: rwhod will drop privledges and become the given user.
reviewed by jwise
2005-09-12 16:13:13 +00:00
christos cb1d68978b Patch from Liam J. Foy:
- cleanup sendto code.
- fix usage.
2005-07-05 02:46:36 +00:00
christos 6b7013d1ad Change g flag to i as in the PR.
Don't allow interval to be set to > 11 minutes.
Rephrase option blurb.
2005-07-01 15:31:18 +00:00
christos c36c99ef66 PR/30648: Liam J. Foy: rwhod patch to reduce time interval between broadcasts 2005-07-01 13:07:21 +00:00
junyoung 632e7ed58f Remove a unnecessary semicolon and trailing spaces. 2005-06-27 12:07:46 +00:00
peter c14c7a6bb6 - Use the timer* macros from sys/time.h, no need to invent a new time add
function if it already exists.
- Improve a few function/variable names and use EXIT_FAILURE.
2005-06-24 13:47:30 +00:00
christos a8b658e375 Initialize events not revents. Noted by Peter Postma. The timer changes he
can make himself :-)
2005-06-24 13:24:23 +00:00
christos f17eeccada Fixes from Liam J. Foy to use poll, and proper signals. (from OpenBSD)
While there, ansify, and fix const abuse.
2005-06-24 13:22:09 +00:00
dsl 9122339b9f Add (unsigned char) cast to ctype functions 2004-10-30 15:39:39 +00:00
agc 326b2259b7 Move UCB-licensed code from 4-clause to 3-clause licence.
Patches provided by Joel Baker in PR 22366, verified by myself.
2003-08-07 11:25:11 +00:00
itojun d9f2774c1e use bounded string op 2003-07-13 12:08:28 +00:00
christos 50455a9139 PR/20318: Johnny Billquist: rwhod does not compile with -DDEBUG 2003-02-12 17:49:35 +00:00
christos b166b5b47b use utmpx. 2002-08-02 02:38:15 +00:00
is d8302e2d73 More format string cleanups by sommerfeld. 2000-10-11 20:23:46 +00:00
itojun c8ebe62e8b avoid memory leak on realloc() error. 1999-12-30 09:10:28 +00:00
mjl f214fa323a From FreeBSD bin/14844 (slightly modified): Due to signed calculations
with the packet size, a short packet would trigger an infinite loop
on little endian machines.
1999-11-15 15:59:24 +00:00
thorpej bcd4659148 Use pidfile(3). 1999-06-06 03:27:35 +00:00
mrg 31283e2cd0 fix error in previous pointed out by bad. minor KNFing. 1998-07-08 15:17:57 +00:00
mrg 32f519716b - 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:56:06 +00:00
lukem e5d6d67c63 deprecate register, use warn/err 1997-10-18 11:37:10 +00:00
lukem 8d79db1093 WARNSify 1997-10-17 13:13:40 +00:00
kleink 66105c37fc Lseek(2) usage cleanup: the use of L_SET/L_INCR/L_XTND is deprecated,
use SEEK_SET/SEEK_CUR/SEEK_END instead.
1997-08-25 19:31:43 +00:00
explorer d3a4eeb1fe Fix some potential buffer overflow problems.
From David Holland <dholland@hcs.harvard.edu>
1996-09-07 21:05:37 +00:00
jtc 9afcf17bec sync with 44lite 1994-05-29 02:53:21 +00:00
andrew b55bc39b4e rwhod wasn't too happy after the off_t change - its lseek() to check the
boottime was broken.  Replaced this code with kvm_nlist()/kvm_read() to be
more efficient.
1994-04-06 03:01:46 +00:00
cgd 7a6e889600 kill bad casts 1994-03-30 02:28:43 +00:00
cgd 20137a28c8 kill extern'd lseek() 1994-03-28 07:08:56 +00:00
mycroft aa14f04fcb From: mrm@sceard.com (M.R.Murphy)
Fix memory leak.
1993-12-15 23:52:40 +00:00
mycroft e9d867ef50 Add RCS identifiers. 1993-08-01 17:54:45 +00:00
mycroft 5a78b45371 Cleanup for GCC 2. 1993-04-18 20:22:09 +00:00
cgd e541169ce2 after 0.2.2 "stable" patches applied 1993-03-21 18:04:42 +00:00