DragonFly BSD
DragonFly bugs List (threaded) for 2006-03
[Date Prev][Date Next]  [Thread Prev][Thread Next]  [Date Index][Thread Index]

A bugfix for DragonFly's adjtime() implementation


From: "Frank W. Josellis" <frank@xxxxxxxxxxxxxxxxxxxxx>
Date: Sun, 19 Mar 2006 15:22:35 +0100 (CET)

While testing a clock synchronization software on DragonFly I observed a 
problem with the adjtime(2) system call. The retrieved olddelta values 
appeared to be quite incorrect, and the reason for this eventually turned 
out to be an elementary bug which can be fixed by the patch below. Please 
have a look at it, I'd think this case is pretty clear and needs no further 
description.

Frank Josellis


--- patch begins here ---
--- sys/kern/kern_time.c.orig	2005-10-08 14:24:26.000000000 +0200
+++ sys/kern/kern_time.c	2006-03-18 23:53:37.000000000 +0100
@@ -547,7 +547,7 @@
 
 	if (uap->olddelta) {
 		atv.tv_sec = odelta / 1000000000;
-		atv.tv_usec = odelta % 1000000 / 1000;
+		atv.tv_usec = odelta % 1000000000 / 1000;
 		(void) copyout((caddr_t)&atv, (caddr_t)uap->olddelta,
 		    sizeof(struct timeval));
 	}
--- patch ends here ---




[Date Prev][Date Next]  [Thread Prev][Thread Next]  [Date Index][Thread Index]