mirror of
https://gitlab.freedesktop.org/NetworkManager/NetworkManager
synced 2024-07-22 10:46:59 +00:00
shared: implement _nm_utils_monotonic_timestamp_initialized() in "nm-logging-stub.c"
This commit is contained in:
parent
4c78434a0b
commit
2946d07085
|
@ -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)
|
||||
|
||||
|
|
|
@ -298,6 +298,7 @@ exe = executable(
|
|||
],
|
||||
dependencies: [
|
||||
shared_nm_glib_aux_dep,
|
||||
libnm_systemd_shared_no_logging_dep,
|
||||
shared_c_siphash_dep,
|
||||
],
|
||||
)
|
||||
|
|
|
@ -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__ */
|
||||
|
|
|
@ -22,6 +22,8 @@
|
|||
|
||||
#include "nm-time-utils.h"
|
||||
|
||||
#include "nm-logging-fwd.h"
|
||||
|
||||
/*****************************************************************************/
|
||||
|
||||
typedef struct {
|
||||
|
|
|
@ -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__ */
|
||||
|
|
|
@ -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);
|
||||
}
|
||||
|
||||
/*****************************************************************************/
|
||||
|
|
|
@ -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)
|
||||
{
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue