INCLUDE_DIRECTORIES(${CMAKE_SOURCE_DIR}/include)
-SET(PKG_MODULES )
+SET(PKG_MODULES dlog)
IF(LIBSYSTEMD STREQUAL on)
SET(PKG_MODULES ${PKG_MODULES} libsystemd)
#define API __attribute__ ((visibility("default")))
#endif
+#ifndef LOG_TAG
+#define LOG_TAG "ARGOS_WATCHDOG"
+#endif
+#include <dlog.h>
+
+#define _D(fmt, arg...) SLOGD(fmt, ##arg)
+#define _I(fmt, arg...) SLOGI(fmt, ##arg)
+#define _W(fmt, arg...) SLOGW(fmt, ##arg)
+#define _E(fmt, arg...) SLOGE(fmt, ##arg)
+
int _aw_register(unsigned int timeout);
int _aw_control(aw_op_e op, void *data);
int _aw_notify(void);
Requires(post): /sbin/ldconfig
Requires(postun): /sbin/ldconfig
BuildRequires: cmake
+BuildRequires: pkgconfig(dlog)
%if %{?libsystemd} == on
BuildRequires: pkgconfig(libsystemd)
%endif
/* https://github.com/systemd/systemd/commit/2787d83c2 */
int systemd_change_watchdog_timeout(unsigned int timeout)
{
- return sd_notifyf(0, "WATCHDOG_USEC=%llu", (unsigned long long) timeout*SEC_TO_USEC);
+ int ret;
+
+ ret = sd_notifyf(0, "WATCHDOG_USEC=%llu", (unsigned long long) timeout*SEC_TO_USEC);
+ if (ret <= 0)
+ _E("sd notify failed ret=%d, timeout=%u", ret, timeout);
+
+ return ret;
}
int _aw_register(unsigned int timeout)