Re: [PATCH] selftests: watchdog: get boot reason via WDIOC_GETBOOTSTATUS

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 5/27/17 1:26 PM, Eugeniu Rosca wrote:
+        } else if (!strncasecmp(argv[i], "-s", 2)) {
+            ret = ioctl(fd, WDIOC_GETBOOTSTATUS, &bootstatus);
+            if (!ret)
+                printf("Last boot is caused by: %s.\n", (bootstatus != 0) ?
+                       "Watchdog" : "Power-On-Reset");
+            else
+                printf("Error: WDIOC_GETBOOTSTATUS failed.\n");
+            goto end;

So I think you should drop the "goto end" so that the user can continue to execute multiple commands.

On a side note, I just noticed a bug in my code:

} else if (!strncasecmp(argv[i], "-t", 2) && argv[2]) {

and

} else if (!strncasecmp(argv[i], "-p", 2) && argv[2]) {

"argv[2]" is should be "argv[i + 1]"


--
Sent by an employee of the Qualcomm Innovation Center, Inc.
The Qualcomm Innovation Center, Inc. is a member of the
Code Aurora Forum, hosted by The Linux Foundation.
--
To unsubscribe from this list: send the line "unsubscribe linux-kselftest" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Index of Archives]     [Linux Wireless]     [Linux Kernel]     [ATH6KL]     [Linux Bluetooth]     [Linux Netdev]     [Kernel Newbies]     [Share Photos]     [IDE]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux ATA RAID]     [Samba]     [Device Mapper]

  Powered by Linux