Commit Graph

35 Commits

Author SHA1 Message Date
avg
4e6c4b2a36 Revert r253748,253749
This WIP should not have been committed yet.

Pointyhat to:	avg
2013-07-28 18:44:17 +00:00
avg
c8737cbf1c remove needless inclusion of machine/cpu.h in userland
MFC after:	21 days
2013-07-28 18:35:43 +00:00
ed
02dcf28b58 Rework all non-contributed files that use `struct timezone'.
This structure is not part of POSIX. According to POSIX, gettimeofday()
has the following prototype:

	int gettimeofday(struct timeval *restrict tp, void *restrict tzp);

Also, POSIX states that gettimeofday() shall return 0 (as long as tzp is
not used). Remove dead error handling code. Also use NULL for a
nul-pointer instead of integer 0.

While there, change all pieces of code that only use tv_sec to use
time(3), as this provides less overhead.
2012-09-01 14:45:15 +00:00
ru
bc1ba9dbff If not compiled for debugging, redirect standard input/output/error
to /dev/null before becoming a daemon.
2006-10-23 10:48:19 +00:00
pjd
b20e637376 Correct various mistakes in the last commit. 2006-05-13 11:58:58 +00:00
phk
9690ea4717 Use sysctlbyname 2006-05-11 17:25:36 +00:00
ghelmer
3739062957 Invoke tzset(3) within the main loop to catch changes to /etc/localtime
when running as a daemon in the hope that it will fix situations
where the CMOS clock was apparently set using the stale TZ offset.
2004-04-27 14:43:03 +00:00
obrien
19105c8312 Use __FBSDID() to quiet GCC 3.3 warnings. 2003-05-03 18:41:59 +00:00
imp
3edee7e57e o Use real prototypes
o Remove __P.
o main(int, char *[])
2002-03-18 04:55:09 +00:00
dd
9d59f764e6 Fix a prototype and set WARNS=2.
Submitted by:	Mike Barcroft <mike@q9media.com>
2001-07-15 05:41:57 +00:00
peter
76f0c923fe $Id$ -> $FreeBSD$ 1999-08-28 00:22:10 +00:00
charnier
2e78576848 Correct use of .Nm. Add missing .El. Add rcsid. Remove unused #include. 1998-06-04 06:35:12 +00:00
ache
a82f906952 Implement Helbig idea of offset calculation reducing mktime() calls
Immediately exit if /etc/wall_cmos_clock not present
1998-04-11 21:18:55 +00:00
ache
add2782c4e Add workaround suggestion for 'nonexistent time' diagnostic 1998-03-30 09:29:47 +00:00
ache
0398ae2bf7 Minimize clock drift between getting and setting time
Submitted by: bde
1998-02-25 09:40:21 +00:00
charnier
7be0d348a8 Add Id, add usage function. 1997-06-10 11:01:13 +00:00
imp
167db52912 compare return value from getopt against -1 rather than EOF, per the final
posix standard on the topic.
1997-03-29 03:33:12 +00:00
ache
fec10bb459 Detect if /etc/wall_cmos_clock gone while adjkerntz paused. 1996-04-05 19:17:05 +00:00
ache
8d7c1b3d2a Dynamically sense /etc/wall_cmos_clock presence/absense 1996-04-05 16:25:38 +00:00
ache
4fc02548e5 Fix error with multiply 'adjkerntz -a' copies running.
Manage adjkerntz kernel variable even for UTC clocks.
Code cleanup.
1996-04-05 03:40:55 +00:00
rgrimes
f3a2b348da Remove trailing whitespace. 1995-05-30 06:12:45 +00:00
ache
e6a1b97276 Use more AI to predict initial/final isdst,
latest isdst  preffered.
1995-03-26 22:51:51 +00:00
ache
6476aa24f1 Use timelocal() instead of mktime() hack 1994-12-26 10:43:48 +00:00
ache
7e73ded5b5 Fix resetting adjkerntz to 0 (pointed by Bruce),
forget to initialize mib variable.
1994-12-12 05:48:45 +00:00
ache
1ff1e1698a Optimize setting of DISRTCSET 1994-12-12 05:43:28 +00:00
ache
14cf84efe4 Clean internal logic, helps for some unusual cases 1994-12-12 05:20:44 +00:00
ache
a3d03a23fc -i case goes to background pause and acts like -a case on receiving
SIGTERM. This helps to keep CMOS clock updated before reboot.
Idea from J.Wunsch.
1994-11-03 03:16:16 +00:00
ache
fdf434f26c Restore back -i, -a 1994-11-02 09:40:06 +00:00
ache
30655c5010 Remove options, run adjkerntz as daemon now 1994-11-01 16:22:22 +00:00
ache
d6c1596a63 Now:
adjkerntz -i writes kernel clock only, don't touch RTC clock
adjkerntz -a writes RTC clock only, don't touch kernel clock
1994-11-01 06:20:52 +00:00
ache
ff7b200770 Modify adjkerntz to not write RTC clock per initial call,
suggested by Bruce
1994-10-04 19:15:13 +00:00
ache
3eb6939663 rewritted to use sysctl, no more /var/run/.adjkerntz now 1994-09-19 23:09:34 +00:00
ache
1cb41ef19c Cosmetique patch from bde 1994-02-05 11:42:48 +00:00
ache
0945afb843 Fix sign of offset diff.
Use Bruce initial/final hour scheme to avoid critical hours.
1993-12-20 01:53:27 +00:00
ache
788c91c4db Attempt to import adjkerntz... 1993-12-16 18:44:40 +00:00