From: Eugeniu Rosca Date: Sat, 1 Jul 2017 12:57:28 +0000 (+0200) Subject: selftests: watchdog: point out ioctl() failures X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=42f34c4e245641d1bae88de469053d3c3aa4d9fa;p=GitHub%2FLineageOS%2Fandroid_kernel_motorola_exynos9610.git selftests: watchdog: point out ioctl() failures Report the failure of WDIOC_SETOPTIONS/WDIOC_SETTIMEOUT ioctls. Signed-off-by: Eugeniu Rosca Signed-off-by: Shuah Khan --- 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]);