Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 03 Aug 1997 11:44:12 +0000
From:      Gary Jennejohn <garyj@munich.netsurf.de>
To:        freebsd-current@freebsd.org
Subject:   Re: clock_settime() error? 
Message-ID:  <199708031144.LAA19759@peedub.gj.org>
In-Reply-To: Your message of "Sat, 03 Aug 1997 08:26:39 %2B0200." <199708030626.IAA06139@zibbi.mikom.csir.co.za> 

next in thread | previous in thread | raw e-mail | index | archive | help
John Hay writes:
>Hi,
>
>I have been playing with the latest xntpd and I got "Can't set time of
>day: Invalid argument" errors when it tried to step the time. I have
>traced it to the clock_settime() system call in kern_time.c. I think
>the test on line 171 is invalid:
>
>-------
>        if ((error = copyin(SCARG(uap, tp), &ats, sizeof(ats))) != 0)   
>		return (error);       
>	if (atv.tv_usec < 0 || ats.tv_nsec >= 1000000000)
>	    ^^^^^^^^^^^
>		return (EINVAL);      
>	TIMESPEC_TO_TIMEVAL(&atv, &ats);
>-------
>
>At that time atv.tv_usec hasn't been assigned yet. It is only assigned a
>value two lines late in the TIMESPEC_TO_TIMEVAL() macro. Shouldn't it be
>ats.tv_sec? Or ats.tv_nsec maybe?
>

looks to me like it should be ats.tv_usec. It's checking the passed-in
                                ^
values.

---
Gary Jennejohn
Home - Gary.Jennejohn@munich.netsurf.de
Work - gjennejohn@frt.dec.com




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?199708031144.LAA19759>