forked from Minki/linux
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>
This commit is contained in:
parent
7a5e10d439
commit
42f34c4e24
@ -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]);
|
||||
|
Loading…
Reference in New Issue
Block a user