svn commit: r336781 - head/tests/sys/kqueue/libkqueue

Ian Lepore ian at freebsd.org
Fri Jul 27 20:39:50 UTC 2018


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);
> 


More information about the svn-src-head mailing list