From owner-cvs-all Tue Nov 28 18:26: 1 2000 Delivered-To: cvs-all@freebsd.org Received: from chmls05.mediaone.net (chmls05.mediaone.net [24.147.1.143]) by hub.freebsd.org (Postfix) with ESMTP id B251337B400; Tue, 28 Nov 2000 18:25:56 -0800 (PST) Received: from acm.org (reyim.ne.mediaone.net [24.218.251.241]) by chmls05.mediaone.net (8.8.7/8.8.7) with ESMTP id VAA04222; Tue, 28 Nov 2000 21:25:43 -0500 (EST) Message-ID: <3A246914.ACD49F96@acm.org> Date: Tue, 28 Nov 2000 21:25:24 -0500 From: Jim Bloom X-Mailer: Mozilla 4.75 [en]C-MOENE (Win98; U) X-Accept-Language: en MIME-Version: 1.0 To: "Jeroen C. van Gelderen" Cc: Alfred Perlstein , Warner Losh , "Brian F. Feldman" , obrien@FreeBSD.ORG, cvs-committers@FreeBSD.ORG, cvs-all@FreeBSD.ORG Subject: Re: cvs commit: src/usr.sbin/inetd builtins.c References: <20001126182240.A8051@fw.wintelcom.net> <200011262140.eAQLe2576200@green.dyndns.org> <20001126182240.A8051@fw.wintelcom.net> <200011280524.WAA07413@harmony.village.org> <20001127221535.Y8051@fw.wintelcom.net> <3A245F2C.9842890E@vangelderen.org> Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Sender: owner-cvs-all@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG You might try the following, but the consensus seems to be to not worry about enforcing the restrictions. ASSERT(to.tv_usec < 1000000); ASSERT(tv.tv_usec < 1000000); to.tv_usec += tv.tv_usec; if (to.tv_usec >= 1000000) { to.tv_usec -= 1000000; to.tv_sec++; } Jim Bloom bloom@acm.org "Jeroen C. van Gelderen" wrote: > > So, shouldn't it be: > > ASSERT(to.tv_usec < 2000000); > to.tv_usec += tv.tv_usec; > if (to.tv_usec >= 1000000) { > to.tv_usec -= 1000000; > to.tv_sec++; > } > > This will catch unwarranted assumptions and/or > broken code *and* would have prevented Warner's > question *and* will prevent future confusion > while maintaining efficiency. To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe cvs-all" in the body of the message