[systemd-devel] [PATCH] watchdog: really return the actual watchdog timeout

Michael Olbrich m.olbrich at pengutronix.de
Fri Apr 6 12:37:26 PDT 2012


In the current code setting the return argument is never reached.

---
 src/watchdog.c |    7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/src/watchdog.c b/src/watchdog.c
index 9625e15..372c16f 100644
--- a/src/watchdog.c
+++ b/src/watchdog.c
@@ -98,6 +98,7 @@ static int open_watchdog(void) {
 }
 
 int watchdog_set_timeout(usec_t *usec) {
+        int r;
 
         watchdog_timeout = *usec;
 
@@ -107,11 +108,13 @@ int watchdog_set_timeout(usec_t *usec) {
                 return 0;
 
         if (watchdog_fd < 0)
-                return open_watchdog();
+                r = open_watchdog();
         else
-                return update_timeout();
+                r = update_timeout();
 
         *usec = watchdog_timeout;
+
+        return r;
 }
 
 int watchdog_ping(void) {
-- 
1.7.9.5



More information about the systemd-devel mailing list