]> git.baikalelectronics.ru Git - kernel.git/commit
selftests: timers: set-timer-lat: fix hang when std out/err are redirected
authorShuah Khan <shuahkh@osg.samsung.com>
Thu, 21 Sep 2017 19:46:01 +0000 (13:46 -0600)
committerShuah Khan <shuahkh@osg.samsung.com>
Mon, 25 Sep 2017 16:09:06 +0000 (10:09 -0600)
commit40b06e4b47ce7acaa9648e93a5ecaa16c179a0b4
treedecd8fa909f501187912abaf052566f747ba46f6
parentdb4683dc8d102b6df5e4d8ace194619c342ffa41
selftests: timers: set-timer-lat: fix hang when std out/err are redirected

do_timer_oneshot() uses select() as a timer with FD_SETSIZE and readfs
is cleared with FD_ZERO without FD_SET.

When stdout and stderr are redirected, the test hangs in select forever.
Fix the problem calling select() with readfds empty and nfds zero. This
is sufficient for using select() for timer.

With this fix "./set-timer-lat > /dev/null 2>&1" no longer hangs.

Signed-off-by: Shuah Khan <shuahkh@osg.samsung.com>
Acked-by: Greg Hackmann <ghackmann@google.com>
Signed-off-by: Shuah Khan <shuahkh@osg.samsung.com>
tools/testing/selftests/timers/set-timer-lat.c