From fe18f3853ef7d893cd13f4d1b3973c6aedfcf75d Mon Sep 17 00:00:00 2001 From: Warner Losh Date: Fri, 12 Jan 2007 07:40:30 +0000 Subject: [PATCH] When ntp_gettime() was converted from a sysctl + wrapper to a system call, its semantics were unintentionally changed. It went from returning the time state to returning 0 or -1. Since 0 means time normal, and non-zero effectively only shows up around leap seconds, this went unnoticed until now. At least unnoticed until someone was trying to run a binary they didn't have source for and it was misbehaving... Submitted by: Judah Levine MFC After: 2 weeks --- sys/kern/kern_ntptime.c | 1 + 1 file changed, 1 insertion(+) diff --git a/sys/kern/kern_ntptime.c b/sys/kern/kern_ntptime.c index 87d10d773d33..7d2c8fa1dbcf 100644 --- a/sys/kern/kern_ntptime.c +++ b/sys/kern/kern_ntptime.c @@ -268,6 +268,7 @@ ntp_gettime(struct thread *td, struct ntp_gettime_args *uap) ntp_gettime1(&ntv); mtx_unlock(&Giant); + td->td_retval[0] = ntv.time_state; return (copyout(&ntv, uap->ntvp, sizeof(ntv))); }