watchdog_fd() is returning a char* and not a int. checking against < 0 could
lead in undefined behaviour.
Signed-off-by: Alexander Couzens <lynxis@fe80.eu>
if (tb[WDT_STOP])
watchdog_set_stopped(blobmsg_get_bool(tb[WDT_STOP]));
if (tb[WDT_STOP])
watchdog_set_stopped(blobmsg_get_bool(tb[WDT_STOP]));
+ if (watchdog_fd() == NULL)
status = "offline";
else if (watchdog_get_stopped())
status = "stopped";
status = "offline";
else if (watchdog_get_stopped())
status = "stopped";