summaryrefslogtreecommitdiff
path: root/src/journal
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2013-11-07 22:17:19 +0100
committerLennart Poettering <lennart@poettering.net>2013-11-07 22:17:19 +0100
commit47c649b5de480b832bb11e0d52ba58d962d61fb2 (patch)
treef828ca63763cde835ffba62be6eea71cd2e33040 /src/journal
parent40be0704eb4784ee01f60442396a70f797281744 (diff)
bus: use new property retrieval calls everywhere
Diffstat (limited to 'src/journal')
-rw-r--r--src/journal/journal-gatewayd.c24
1 files changed, 6 insertions, 18 deletions
diff --git a/src/journal/journal-gatewayd.c b/src/journal/journal-gatewayd.c
index 093dc74e2c..c51afbfeb9 100644
--- a/src/journal/journal-gatewayd.c
+++ b/src/journal/journal-gatewayd.c
@@ -742,9 +742,7 @@ static int request_handler_file(
}
static int get_virtualization(char **v) {
- _cleanup_bus_message_unref_ sd_bus_message *reply = NULL;
_cleanup_bus_unref_ sd_bus *bus = NULL;
- const char *t;
char *b;
int r;
@@ -752,33 +750,23 @@ static int get_virtualization(char **v) {
if (r < 0)
return r;
- r = sd_bus_call_method(
+ r = sd_bus_get_property_string(
bus,
"org.freedesktop.systemd1",
"/org/freedesktop/systemd1",
- "org.freedesktop.DBus.Properties",
- "Get",
- NULL,
- &reply,
- "ss",
"org.freedesktop.systemd1.Manager",
- "Virtualization");
- if (r < 0)
- return r;
-
- r = sd_bus_message_read(reply, "v", "s", &t);
+ "Virtualization",
+ NULL,
+ &b);
if (r < 0)
return r;
- if (isempty(t)) {
+ if (isempty(b)) {
+ free(b);
*v = NULL;
return 0;
}
- b = strdup(t);
- if (!b)
- return -ENOMEM;
-
*v = b;
return 1;
}