On Sat, May 27, 2017 at 05:25:39PM -0500, Timur Tabi wrote: > 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. Thanks for feedback. My intent was to make getting the boot status a "one-shot" command without entering the keep_alive() loop. Since there is no infrastructure in the test file to distinguish between such one-shot commands and commands that can be stacked/chained (this would require some more sophisticated parameter processing), I am open minded to send you an updated version. > > 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]" > Should I put the two patches (argv[2] fix and WDIOC_GETBOOTSTATUS-v2) under the same cover letter or push them separately? Thanks again! > > -- > 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