summaryrefslogtreecommitdiff
path: root/tools
diff options
context:
space:
mode:
authorEugeniu Rosca <erosca@de.adit-jv.com>2017-07-01 14:57:28 +0200
committerShuah Khan <shuahkh@osg.samsung.com>2017-07-24 12:36:55 -0600
commit42f34c4e245641d1bae88de469053d3c3aa4d9fa (patch)
tree411e2f1de7ad943ef8e94383000b4a0514ef1d3a /tools
parent7a5e10d439b162ae76e7d7a1bbd5653e62abb5bf (diff)
downloadlwn-42f34c4e245641d1bae88de469053d3c3aa4d9fa.tar.gz
lwn-42f34c4e245641d1bae88de469053d3c3aa4d9fa.zip
selftests: watchdog: point out ioctl() failures
Report the failure of WDIOC_SETOPTIONS/WDIOC_SETTIMEOUT ioctls. Signed-off-by: Eugeniu Rosca <erosca@de.adit-jv.com> Signed-off-by: Shuah Khan <shuahkh@osg.samsung.com>
Diffstat (limited to 'tools')
-rw-r--r--tools/testing/selftests/watchdog/watchdog-test.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/tools/testing/selftests/watchdog/watchdog-test.c b/tools/testing/selftests/watchdog/watchdog-test.c
index 5cfa88c73095..41f40c3c4d95 100644
--- a/tools/testing/selftests/watchdog/watchdog-test.c
+++ b/tools/testing/selftests/watchdog/watchdog-test.c
@@ -94,12 +94,16 @@ int main(int argc, char *argv[])
ret = ioctl(fd, WDIOC_SETOPTIONS, &flags);
if (!ret)
printf("Watchdog card disabled.\n");
+ else
+ printf("WDIOS_DISABLECARD errno '%s'\n", strerror(errno));
break;
case 'e':
flags = WDIOS_ENABLECARD;
ret = ioctl(fd, WDIOC_SETOPTIONS, &flags);
if (!ret)
printf("Watchdog card enabled.\n");
+ else
+ printf("WDIOS_ENABLECARD errno '%s'\n", strerror(errno));
break;
case 'p':
ping_rate = strtoul(optarg, NULL, 0);
@@ -110,6 +114,8 @@ int main(int argc, char *argv[])
ret = ioctl(fd, WDIOC_SETTIMEOUT, &flags);
if (!ret)
printf("Watchdog timeout set to %u seconds.\n", flags);
+ else
+ printf("WDIOC_SETTIMEOUT errno '%s'\n", strerror(errno));
break;
default:
usage(argv[0]);