diff --git a/Makefile.am b/Makefile.am index a8e67e720a..ed8bb70d09 100644 --- a/Makefile.am +++ b/Makefile.am @@ -488,6 +488,7 @@ shared_nm_utils_tests_test_shared_general_LDFLAGS = \ shared_nm_utils_tests_test_shared_general_LDADD = \ shared/nm-glib-aux/libnm-glib-aux.la \ + shared/systemd/libnm-systemd-logging-stub.la \ $(GLIB_LIBS) \ $(NULL) diff --git a/shared/meson.build b/shared/meson.build index 65fdfcabc7..ddb991094c 100644 --- a/shared/meson.build +++ b/shared/meson.build @@ -298,6 +298,7 @@ exe = executable( ], dependencies: [ shared_nm_glib_aux_dep, + libnm_systemd_shared_no_logging_dep, shared_c_siphash_dep, ], ) diff --git a/shared/nm-glib-aux/nm-logging-fwd.h b/shared/nm-glib-aux/nm-logging-fwd.h index 693803f9d4..c60a20b58b 100644 --- a/shared/nm-glib-aux/nm-logging-fwd.h +++ b/shared/nm-glib-aux/nm-logging-fwd.h @@ -127,4 +127,14 @@ nm_log_level_from_syslog (int syslog_level) } } +/*****************************************************************************/ + +struct timespec; + +/* this function must be implemented to handle the notification when + * the first monotonic-timestamp is fetched. */ +extern void _nm_utils_monotonic_timestamp_initialized (const struct timespec *tp, + gint64 offset_sec, + gboolean is_boottime); + #endif /* __NM_LOGGING_DEFINES_H__ */ diff --git a/shared/nm-glib-aux/nm-time-utils.c b/shared/nm-glib-aux/nm-time-utils.c index 98a414595a..81f88f7c03 100644 --- a/shared/nm-glib-aux/nm-time-utils.c +++ b/shared/nm-glib-aux/nm-time-utils.c @@ -22,6 +22,8 @@ #include "nm-time-utils.h" +#include "nm-logging-fwd.h" + /*****************************************************************************/ typedef struct { diff --git a/shared/nm-glib-aux/nm-time-utils.h b/shared/nm-glib-aux/nm-time-utils.h index 7e4f4f25f7..9468cbc985 100644 --- a/shared/nm-glib-aux/nm-time-utils.h +++ b/shared/nm-glib-aux/nm-time-utils.h @@ -34,12 +34,4 @@ nm_utils_get_monotonic_timestamp_ns_cached (gint64 *cache_now) ?: (*cache_now = nm_utils_get_monotonic_timestamp_ns ()); } -struct timespec; - -/* this function must be implemented to handle the notification when - * the first monotonic-timestamp is fetched. */ -extern void _nm_utils_monotonic_timestamp_initialized (const struct timespec *tp, - gint64 offset_sec, - gboolean is_boottime); - #endif /* __NM_TIME_UTILS_H__ */ diff --git a/shared/nm-utils/tests/test-shared-general.c b/shared/nm-utils/tests/test-shared-general.c index ddf1ef7823..ff0906fdf7 100644 --- a/shared/nm-utils/tests/test-shared-general.c +++ b/shared/nm-utils/tests/test-shared-general.c @@ -29,24 +29,10 @@ /*****************************************************************************/ -static int _monotonic_timestamp_initialized; - -void -_nm_utils_monotonic_timestamp_initialized (const struct timespec *tp, - gint64 offset_sec, - gboolean is_boottime) -{ - g_assert (!_monotonic_timestamp_initialized); - _monotonic_timestamp_initialized = 1; -} - -/*****************************************************************************/ - static void test_monotonic_timestamp (void) { g_assert (nm_utils_get_monotonic_timestamp_s () > 0); - g_assert (_monotonic_timestamp_initialized); } /*****************************************************************************/ diff --git a/shared/systemd/nm-logging-stub.c b/shared/systemd/nm-logging-stub.c index 5969922847..95ff51e538 100644 --- a/shared/systemd/nm-logging-stub.c +++ b/shared/systemd/nm-logging-stub.c @@ -45,3 +45,10 @@ _nm_log_impl (const char *file, ...) { } + +void +_nm_utils_monotonic_timestamp_initialized (const struct timespec *tp, + gint64 offset_sec, + gboolean is_boottime) +{ +}