chiark / gitweb /
event: hook up sd-event with the service watchdog logic
[elogind.git] / src / shared / time-util.h
index 7660fe18724ad2108baaf5f60aad211f8c0d8704..0a3a98b1879f2b4b4427034f7916e1275167faaa 100644 (file)
@@ -64,7 +64,10 @@ dual_timestamp* dual_timestamp_get(dual_timestamp *ts);
 dual_timestamp* dual_timestamp_from_realtime(dual_timestamp *ts, usec_t u);
 dual_timestamp* dual_timestamp_from_monotonic(dual_timestamp *ts, usec_t u);
 
-#define dual_timestamp_is_set(ts) ((ts)->realtime > 0)
+static inline bool dual_timestamp_is_set(dual_timestamp *ts) {
+        return ((ts->realtime > 0 && ts->realtime != (usec_t) -1) ||
+                (ts->monotonic > 0 && ts->monotonic != (usec_t) -1));
+}
 
 usec_t timespec_load(const struct timespec *ts) _pure_;
 struct timespec *timespec_store(struct timespec *ts, usec_t u);
@@ -84,3 +87,5 @@ int parse_timestamp(const char *t, usec_t *usec);
 
 int parse_sec(const char *t, usec_t *usec);
 int parse_nsec(const char *t, nsec_t *nsec);
+
+bool ntp_synced(void);