]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/commit
Correct possible misleading error message in kqtest.
authordab <dab@FreeBSD.org>
Mon, 30 Jul 2018 14:21:49 +0000 (14:21 +0000)
committerdab <dab@FreeBSD.org>
Mon, 30 Jul 2018 14:21:49 +0000 (14:21 +0000)
commit66684874fa37d2d0b76a6656eb600f9c1c38a3d4
tree632d5ce705f790d14380421d5c89e1617a809658
parent090097cfe68e37bcee021df3b895da7332d607d8
Correct possible misleading error message in kqtest.

ian@ pointed out that in the test_abstime() function time(NULL) is
used twice; once in an "if" test and again in the enclosed error
message. If the true branch was taken and the process got preempted
before the second time(NULL) call, by the time the error message was
generated enough time could have elapsed that the message could claim
that the event came "too early" but print an event time that was after
the expected timeout. Correct by making the time(NULL) call only once
and using that returned time in both the "if" test and the error
message.

Reported by: ian@
MFC after: 4 days
X-MFC-with: r336761, r336781, r336802
Sponsored by: Dell EMC
tests/sys/kqueue/libkqueue/timer.c