#include <linux/types.h>
#include <linux/watchdog.h>
+#define DEFAULT_PING_RATE 1
+
int fd;
const char v = 'V';
static const char sopts[] = "dehp:t:";
printf(" -d, --disable Turn off the watchdog timer\n");
printf(" -e, --enable Turn on the watchdog timer\n");
printf(" -h, --help Print the help message\n");
- printf(" -p, --pingrate=P Set ping rate to P seconds\n");
+ printf(" -p, --pingrate=P Set ping rate to P seconds (default %d)\n", DEFAULT_PING_RATE);
printf(" -t, --timeout=T Set timeout to T seconds\n");
printf("\n");
printf("Parameters are parsed left-to-right in real-time.\n");
int main(int argc, char *argv[])
{
int flags;
- unsigned int ping_rate = 1;
+ unsigned int ping_rate = DEFAULT_PING_RATE;
int ret;
int c;
break;
case 'p':
ping_rate = strtoul(optarg, NULL, 0);
+ if (!ping_rate)
+ ping_rate = DEFAULT_PING_RATE;
printf("Watchdog ping rate set to %u seconds.\n", ping_rate);
break;
case 't':