selftests: watchdog: fix message when /dev/watchdog open fails
authorShuah Khan (Samsung OSG) <shuah@kernel.org>
Wed, 26 Sep 2018 19:07:11 +0000 (13:07 -0600)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sun, 1 Dec 2019 08:13:46 +0000 (09:13 +0100)
commitb8676497ea4474bd3bd71a9efbe3a65e9fa761ad
treecee4c2690acd251ac751ab0d2ed994e1756294ac
parentc033f4b76b6168367b83c7a44ff48ac4a31fa14b
selftests: watchdog: fix message when /dev/watchdog open fails

[ Upstream commit 9a244229a4b850b11952a0df79607c69b18fd8df ]

When /dev/watchdog open fails, watchdog exits with "watchdog not enabled"
message. This is incorrect when open fails due to insufficient privilege.

Fix message to clearly state the reason when open fails with EACCESS when
a non-root user runs it.

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