summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2015-02-12 12:28:48 +0100
committerLennart Poettering <lennart@poettering.net>2015-02-12 12:28:48 +0100
commitc2cc6b9aefb6f2085d3ca7eb9743093a17f751da (patch)
treee8b6046940c23ef217682072aef471c1085d5ac7
parent4c08c8242a687e00b289e948ccd07b96f0bc4866 (diff)
core: disarm shutdown watchdog if we fail to set timeout
Better safe than sorry, if drivers are stupid, and reset immediately on device closing if the timeout could not be initialized. https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=777735
-rw-r--r--src/core/main.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/core/main.c b/src/core/main.c
index 0749f0413a..ba2de85bd3 100644
--- a/src/core/main.c
+++ b/src/core/main.c
@@ -2021,8 +2021,8 @@ finish:
/* If we reboot let's set the shutdown
* watchdog and tell the shutdown binary to
* repeatedly ping it */
- watchdog_set_timeout(&arg_shutdown_watchdog);
- watchdog_close(false);
+ r = watchdog_set_timeout(&arg_shutdown_watchdog);
+ watchdog_close(r < 0);
/* Tell the binary how often to ping, ignore failure */
if (asprintf(&e, "WATCHDOG_USEC="USEC_FMT, arg_shutdown_watchdog) > 0)