]> git.ipfire.org Git - thirdparty/libvirt.git/commit
virhostuptime: Add linux stub for musl
authorMichal Privoznik <mprivozn@redhat.com>
Mon, 14 Oct 2019 14:37:03 +0000 (16:37 +0200)
committerMichal Privoznik <mprivozn@redhat.com>
Thu, 14 Nov 2019 14:20:38 +0000 (15:20 +0100)
commit070d6969fe912b8f2e9aadee88c6bdda00a65f4f
treeffcf951a896126a96d2cc4a00b0a109bddafefd0
parent18eeb75dafa65391fd10699712b0429f688eaa47
virhostuptime: Add linux stub for musl

When we want to know the boot timestamp of the host, we can call
virHostGetBootTime(). Under the hood, it uses getutxid() which is
defined by POSIX and properly check for in configure. However,
musl took a path where it declares the function but instead of
providing any useful implementation it returns NULL meaning "no
record found". If that's the case, use our second best option -
/proc/uptime and a bit of maths.

https://bugzilla.redhat.com/show_bug.cgi?id=1760885

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Cole Robinson <crobinso@redhat.com>
po/POTFILES.in
src/util/virhostuptime.c