Gross bug in sys/kern_clock.c

Ray Moody ray at maxwell.physics.purdue.edu
Tue Mar 14 01:58:14 AEST 1989


Index:	sys/sys/kern_clock.c

Description:
	Some variable names are messed up in sys/sys/kern_clock.c

Repeat-By:
	Inspection, mainly.

	We noticed this bug in our system when our clocks started loosing about
	half an hour every day.  (No, I don't happen to know the magic numbers
	to give adjtime() to cause this.)

Fix:
*** /tmp/,RCSt1007315	Mon Mar 13 10:52:35 1989
--- /tmp/,RCSt2007315	Mon Mar 13 10:52:36 1989
***************
*** 78,84
  	register struct proc *p;
  	register int s;
  	int needsoft = 0;
! 	extern int tickdelta, tickadj;
  
  #ifdef is68k
  	lbolt++;				/* ISI: SYSV */

--- 78,84 -----
  	register struct proc *p;
  	register int s;
  	int needsoft = 0;
! 	extern int tickdelta, timedelta;
  
  #ifdef is68k
  	lbolt++;				/* ISI: SYSV */
***************
*** 202,208
  	 * so we don't keep the relatively high clock interrupt
  	 * priority any longer than necessary.
  	 */
! 	if (tickdelta == 0)
  		BUMPTIME(&time, tick)
  	else {
  		register delta;

--- 202,208 -----
  	 * so we don't keep the relatively high clock interrupt
  	 * priority any longer than necessary.
  	 */
! 	if (timedelta == 0)
  		BUMPTIME(&time, tick)
  	else {
  		register delta;
***************
*** 207,215
  	else {
  		register delta;
  
! 		if (tickdelta < 0) {
! 			delta = tick - tickadj;
! 			tickdelta += tickadj;
  		} else {
  			delta = tick + tickadj;
  			tickdelta -= tickadj;

--- 207,215 -----
  	else {
  		register delta;
  
! 		if (timedelta < 0) {
! 			delta = tick - tickdelta;
! 			timedelta += tickdelta;
  		} else {
  			delta = tick + tickdelta;
  			timedelta -= tickdelta;
***************
*** 211,218
  			delta = tick - tickadj;
  			tickdelta += tickadj;
  		} else {
! 			delta = tick + tickadj;
! 			tickdelta -= tickadj;
  		}
  		BUMPTIME(&time, delta);
  /* KLUDGE SUN NFS code  ????

--- 211,218 -----
  			delta = tick - tickdelta;
  			timedelta += tickdelta;
  		} else {
! 			delta = tick + tickdelta;
! 			timedelta -= tickdelta;
  		}
  		BUMPTIME(&time, delta);
  /* KLUDGE SUN NFS code  ????



More information about the Comp.bugs.4bsd.ucb-fixes mailing list