diff mbox series

[1/5] initd: Add ubus argument to trigger watchdog tickle.

Message ID 1bd3926c-4d8c-5bfd-ef2f-336c6f30ef36@meshplusplus.com
State Changes Requested
Headers show
Series [1/5] initd: Add ubus argument to trigger watchdog tickle. | expand

Commit Message

Michael Jones Sept. 29, 2020, 4:21 p.m. UTC
Signed-off-by: Michael Jones <mike@meshplusplus.com>
---
 system.c | 5 +++++
 1 file changed, 5 insertions(+)

 static int watchdog_set(struct ubus_context *ctx, struct ubus_object *obj,
@@ -367,6 +369,9 @@ static int watchdog_set(struct ubus_context *ctx,
struct ubus_object *obj,
         watchdog_timeout(timeout);
     }
 
+    if (tb[WDT_TICKLE] && blobmsg_get_bool(tb[WDT_TICKLE]))
+        watchdog_ping();
+
     if (tb[WDT_MAGICCLOSE])
         watchdog_set_magicclose(blobmsg_get_bool(tb[WDT_MAGICCLOSE]));
diff mbox series

Patch

diff --git a/system.c b/system.c
index 0fb98f1..ef7943a 100644
--- a/system.c
+++ b/system.c
@@ -325,6 +325,7 @@  enum {
     WDT_TIMEOUT,
     WDT_MAGICCLOSE,
     WDT_STOP,
+    WDT_TICKLE,
     __WDT_MAX
 };
 
@@ -333,6 +334,7 @@  static const struct blobmsg_policy
watchdog_policy[__WDT_MAX] = {
     [WDT_TIMEOUT] = { .name = "timeout", .type = BLOBMSG_TYPE_INT32 },
     [WDT_MAGICCLOSE] = { .name = "magicclose", .type = BLOBMSG_TYPE_BOOL },
     [WDT_STOP] = { .name = "stop", .type = BLOBMSG_TYPE_BOOL },
+    [WDT_TICKLE] = { .name = "tickle", .type = BLOBMSG_TYPE_BOOL },
 };