summaryrefslogtreecommitdiffstats
path: root/watchdog.cpp
diff options
context:
space:
mode:
authorWilliam A. Kennington III <wak@google.com>2018-04-23 10:28:28 -0700
committerWilliam A. Kennington III <wak@google.com>2018-04-27 10:42:17 -0700
commit1726df6a09e1970f6d2b3eaab40fcfb6cb256e27 (patch)
tree7cc16d45df51f9cda5cc4238cfb94da35dd66b78 /watchdog.cpp
parent7512a126c3215c0baf2dc77b01dc240cd200dba4 (diff)
downloadphosphor-watchdog-1726df6a09e1970f6d2b3eaab40fcfb6cb256e27.tar.gz
phosphor-watchdog-1726df6a09e1970f6d2b3eaab40fcfb6cb256e27.zip
Implement ResetTimeRemaining Method
A dbus method was recently added that supports performing the watchdog reset and enable in a single action to reduce the amount of the dbus congestion and improve reliability of watchdog resets. Support this method as the build would be broken otherwise. Change-Id: Iac00fc2cf15d4ba06fb67a98e2c29fc3c31b3272 Signed-off-by: William A. Kennington III <wak@google.com>
Diffstat (limited to 'watchdog.cpp')
-rw-r--r--watchdog.cpp9
1 files changed, 9 insertions, 0 deletions
diff --git a/watchdog.cpp b/watchdog.cpp
index 2bfd9b7..5ba0836 100644
--- a/watchdog.cpp
+++ b/watchdog.cpp
@@ -14,6 +14,15 @@ constexpr auto SYSTEMD_SERVICE = "org.freedesktop.systemd1";
constexpr auto SYSTEMD_ROOT = "/org/freedesktop/systemd1";
constexpr auto SYSTEMD_INTERFACE = "org.freedesktop.systemd1.Manager";
+void Watchdog::resetTimeRemaining(bool enableWatchdog)
+{
+ timeRemaining(interval());
+ if (enableWatchdog)
+ {
+ enabled(true);
+ }
+}
+
// Enable or disable watchdog
bool Watchdog::enabled(bool value)
{
OpenPOWER on IntegriCloud