shared: implement _nm_utils_monotonic_timestamp_initialized() in "nm-logging-stub.c"

This commit is contained in:
Thomas Haller 2019-05-18 13:22:52 +02:00
parent 4c78434a0b
commit 2946d07085
7 changed files with 21 additions and 22 deletions

View file

@ -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)

View file

@ -298,6 +298,7 @@ exe = executable(
],
dependencies: [
shared_nm_glib_aux_dep,
libnm_systemd_shared_no_logging_dep,
shared_c_siphash_dep,
],
)

View file

@ -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__ */

View file

@ -22,6 +22,8 @@
#include "nm-time-utils.h"
#include "nm-logging-fwd.h"
/*****************************************************************************/
typedef struct {

View file

@ -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__ */

View file

@ -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);
}
/*****************************************************************************/

View file

@ -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)
{
}