chiark
/
gitweb
/
~ianmdlvl
/
elogind.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
bus: use new property retrieval calls everywhere
[elogind.git]
/
src
/
journal
/
journal-gatewayd.c
diff --git
a/src/journal/journal-gatewayd.c
b/src/journal/journal-gatewayd.c
index 093dc74e2c7bc2d3e695d88efa586919beb697eb..c51afbfeb985fab6fa70704c5036d28b16d202c3 100644
(file)
--- 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) {
}
static int get_virtualization(char **v) {
- _cleanup_bus_message_unref_ sd_bus_message *reply = NULL;
_cleanup_bus_unref_ sd_bus *bus = NULL;
_cleanup_bus_unref_ sd_bus *bus = NULL;
- const char *t;
char *b;
int r;
char *b;
int r;
@@
-752,33
+750,23
@@
static int get_virtualization(char **v) {
if (r < 0)
return r;
if (r < 0)
return r;
- r = sd_bus_
call_method
(
+ r = sd_bus_
get_property_string
(
bus,
"org.freedesktop.systemd1",
"/org/freedesktop/systemd1",
bus,
"org.freedesktop.systemd1",
"/org/freedesktop/systemd1",
- "org.freedesktop.DBus.Properties",
- "Get",
- NULL,
- &reply,
- "ss",
"org.freedesktop.systemd1.Manager",
"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 (r < 0)
return r;
- if (isempty(t)) {
+ if (isempty(b)) {
+ free(b);
*v = NULL;
return 0;
}
*v = NULL;
return 0;
}
- b = strdup(t);
- if (!b)
- return -ENOMEM;
-
*v = b;
return 1;
}
*v = b;
return 1;
}