From: Michal Privoznik Date: Thu, 14 Nov 2019 15:42:51 +0000 (+0100) Subject: virhostuptime: Wrap virHostGetBootTimeProcfs() call in an ifdef X-Git-Url: http://xenbits.xensource.com/gitweb?a=commitdiff_plain;h=1b0de07f41bbe0d23ab96b604428ae55fd22aec0;p=libvirt.git virhostuptime: Wrap virHostGetBootTimeProcfs() call in an ifdef 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 --- diff --git a/src/util/virhostuptime.c b/src/util/virhostuptime.c index 056b5c591a..8c49c3d40e 100644 --- a/src/util/virhostuptime.c +++ b/src/util/virhostuptime.c @@ -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__) */