selftests: watchdog: Fix ioctl SET* error paths to take oneshot exit path
authorShuah Khan (Samsung OSG) <shuah@kernel.org>
Wed, 26 Sep 2018 22:37:43 +0000 (16:37 -0600)
committerShuah Khan (Samsung OSG) <shuah@kernel.org>
Wed, 24 Oct 2018 20:49:36 +0000 (14:49 -0600)
commitd89d08ffd2c5a9043c8df7333d9bee6c09904a8f
treefeb53a418af2e241931fbb18acf081c73f3c9c40
parent7514c39cf1d9433203c9b7c6674dbfa429db804b
selftests: watchdog: Fix ioctl SET* error paths to take oneshot exit path

When ioctls for WDIOC_SETOPTIONS (WDIOS_DISABLECARD or WDIOS_ENABLECARD),
WDIOC_SETTIMEOUT, and WDIOC_SETPRETIMEOUT fail, the error path continues
to handler watchdog timer until user terminates it. When ioctl returns
error, it might not be safe to let the watchdog tick. The error could be
due an unsupported ioctl command or some other error.

Fix it to handle error paths as oneshot to stop the watchdog ticks and
exit right away.

Signed-off-by: Shuah Khan (Samsung OSG) <shuah@kernel.org>
tools/testing/selftests/watchdog/watchdog-test.c