]> xenbits.xensource.com Git - libvirt.git/commitdiff
virhostuptime: Wrap virHostGetBootTimeProcfs() call in an ifdef
authorMichal Privoznik <mprivozn@redhat.com>
Thu, 14 Nov 2019 15:42:51 +0000 (16:42 +0100)
committerMichal Privoznik <mprivozn@redhat.com>
Thu, 14 Nov 2019 15:42:51 +0000 (16:42 +0100)
The virHostGetBootTimeProcfs() function is defined only for Linux
and therefore it's only call should also be done if we're on
Linux.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
src/util/virhostuptime.c

index 056b5c591a9e2aa2c912c683c97dbc8fda0f214f..8c49c3d40e652e3c0846cd282fb39c5060847b3e 100644 (file)
@@ -99,8 +99,10 @@ virHostGetBootTimeOnceInit(void)
     endutxent();
 # endif /* HAVE_GETUTXID */
 
+# ifdef __linux__
     if (bootTimeErrno != 0 || bootTime == 0)
         bootTimeErrno = -virHostGetBootTimeProcfs(&bootTime);
+# endif /* __linux__ */
 }
 
 #else /* !defined(HAVE_GETUTXID) && !defined(__linux__) */