Date: Fri, 27 Jul 2018 14:39:45 -0600 From: Ian Lepore <ian@freebsd.org> To: David Bright <dab@FreeBSD.org>, src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r336781 - head/tests/sys/kqueue/libkqueue Message-ID: <1532723985.61594.88.camel@freebsd.org> In-Reply-To: <201807272014.w6RKEwAp071679@repo.freebsd.org> References: <201807272014.w6RKEwAp071679@repo.freebsd.org>
next in thread | previous in thread | raw e-mail | index | archive | help
On Fri, 2018-07-27 at 20:14 +0000, David Bright wrote: > Author: dab > Date: Fri Jul 27 20:14:58 2018 > New Revision: 336781 > URL: https://svnweb.freebsd.org/changeset/base/336781 > > Log: > Fix compilation error on some arches after r336761. > > A cast for printing an intmax_t was needed in a kqueue test for > some > arches. > > MFC after: 1 week > X-MFC-with: r336761 > Sponsored by: Dell EMC > > Modified: > head/tests/sys/kqueue/libkqueue/timer.c > > Modified: head/tests/sys/kqueue/libkqueue/timer.c > ===================================================================== > ========= > --- head/tests/sys/kqueue/libkqueue/timer.c Fri Jul 27 > 20:07:40 2018 (r336780) > +++ head/tests/sys/kqueue/libkqueue/timer.c Fri Jul 27 > 20:14:58 2018 (r336781) > @@ -239,7 +239,7 @@ test_abstime(void) > kev.fflags = 0; > kevent_cmp(&kev, kevent_get(kqfd)); > if (time(NULL) < when + timeout) > - err(1, "too early %jd %jd", time(NULL), when + timeout); > + err(1, "too early %jd %jd", time(NULL), (intmax_t)(when > + timeout)); > You also need to cast the return value from time(NULL), it's a time_t as well. Unrelated: time(NULL) is used twice; if control takes the true branch of the if, then the process gets preempted before doing the second time(NULL) call, enough time could elapse that the printed results will be pretty confusing because it will be after when+timeout by then. -- Ian > /* Check if the event occurs again */ > sleep(3); >
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?1532723985.61594.88.camel>