analyze: Do no require a full d-bus bus for the plot command (#8539)
authorGuillem Jover <guillem@hadrons.org>
Sat, 7 Apr 2018 18:02:20 +0000 (20:02 +0200)
committerZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
Sat, 7 Apr 2018 18:02:20 +0000 (20:02 +0200)
commit5c69b31c137ffa24bca5a4628f9b4879d0f4e84a
treef1b96f7f3c4f399f54fe4195a9153347997d6220
parente438c57a640ac5afba366531be5e456b9fe22672
analyze: Do no require a full d-bus bus for the plot command (#8539)

The plot command requires a full d-bus bus to fetch the host
information, which seems rather optional, and having a running dbus
daemon is not always desirable. So instead, we try to acquire a full
bus, and if that fails we acquire the systemd bus, in which case we
omit the host information from the output.

We refactor acquire_bus() into two new functions which in addition
makes the call sites clearer.
src/analyze/analyze.c