Date: Tue, 28 Nov 2000 21:25:24 -0500 From: Jim Bloom <bloom@acm.org> To: "Jeroen C. van Gelderen" <jeroen@vangelderen.org> Cc: Alfred Perlstein <bright@wintelcom.net>, Warner Losh <imp@village.org>, "Brian F. Feldman" <green@FreeBSD.ORG>, obrien@FreeBSD.ORG, cvs-committers@FreeBSD.ORG, cvs-all@FreeBSD.ORG Subject: Re: cvs commit: src/usr.sbin/inetd builtins.c Message-ID: <3A246914.ACD49F96@acm.org> References: <20001126182240.A8051@fw.wintelcom.net> <bright@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>
next in thread | previous in thread | raw e-mail | index | archive | help
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
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?3A246914.ACD49F96>
