The idea is to offer callers an init function that they can call
independently to ensure that the global variables get
initialized.
Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Cole Robinson <crobinso@redhat.com>
# util/virhostuptime.h
+virHostBootTimeInit;
virHostGetBootTime;
int
virHostGetBootTime(unsigned long long *when)
{
- if (virOnce(&virHostGetBootTimeOnce, virHostGetBootTimeOnceInit) < 0)
+ if (virHostBootTimeInit() < 0)
return -1;
if (bootTimeErrno) {
*when = bootTime;
return 0;
}
+
+
+int
+virHostBootTimeInit(void)
+{
+ if (virOnce(&virHostGetBootTimeOnce, virHostGetBootTimeOnceInit) < 0)
+ return -1;
+
+ return 0;
+}
int
virHostGetBootTime(unsigned long long *when)
G_GNUC_NO_INLINE;
+
+int
+virHostBootTimeInit(void);