diff options
author | Kunhoon Baik <knhoon.baik@samsung.com> | 2016-08-08 20:16:27 +0900 |
---|---|---|
committer | Kunhoon Baik <knhoon.baik@samsung.com> | 2016-08-08 20:16:27 +0900 |
commit | b4987d09e5dd5178c83876b2d06d8bdf1d67d086 (patch) | |
tree | 395b872b2a83487f39b0cfe8e4c4574a0bc8430b | |
parent | aa432c46404988d821670bb9fa16ee076556472b (diff) | |
download | argos_watchdog-b4987d09e5dd5178c83876b2d06d8bdf1d67d086.tar.gz argos_watchdog-b4987d09e5dd5178c83876b2d06d8bdf1d67d086.tar.bz2 argos_watchdog-b4987d09e5dd5178c83876b2d06d8bdf1d67d086.zip |
[systemd backend] modification of aw_register behavior
Prev : return NOT support
Now : return after checking statically-registered
Change-Id: I2116d7413d2ab662f42f079aad703e7d4976ae99
-rw-r--r-- | src/argos-systemd.c | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/src/argos-systemd.c b/src/argos-systemd.c index e0724ee..493f1f7 100644 --- a/src/argos-systemd.c +++ b/src/argos-systemd.c @@ -16,17 +16,21 @@ #include "common.h" #include <systemd/sd-daemon.h> +#include <stdlib.h> /* In case of watchdog based on systemd sd_notify, * runtime registration does not support. - * It will be supported by resrouced watchdog in the future */ - + * Thus, just check whether the watchdog is enabled or not*/ int _aw_register(unsigned int timeout) { - return -ENOTSUP; + + if ( sd_watchdog_enabled(0, NULL) ) + return 0; + else + return -1; } -/* Under development - Ask to Mr.Hwang for the progress */ +/* NOT Support for systemd backend */ int _aw_control(aw_op_e op, void *data) { return -ENOTSUP; |