[systemd backend] modification of aw_register behavior 82/82982/1
authorKunhoon Baik <knhoon.baik@samsung.com>
Mon, 8 Aug 2016 11:16:27 +0000 (20:16 +0900)
committerKunhoon Baik <knhoon.baik@samsung.com>
Mon, 8 Aug 2016 11:16:27 +0000 (20:16 +0900)
Prev : return NOT support
Now  : return after checking statically-registered

Change-Id: I2116d7413d2ab662f42f079aad703e7d4976ae99

src/argos-systemd.c

index e0724ee476175bea89d75339aaec9ebbd9bfa442..493f1f7d468c3c11c80905987f87e2c2eda11ee7 100644 (file)
 
 #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;