chiark
/
gitweb
/
~ianmdlvl
/
elogind.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
nspawn: add new --personality= switch to make it easier to run 32bit containers on...
[elogind.git]
/
src
/
journal
/
journal-gatewayd.c
diff --git
a/src/journal/journal-gatewayd.c
b/src/journal/journal-gatewayd.c
index 093dc74e2c7bc2d3e695d88efa586919beb697eb..5c35d8e77ec8a332f76acb83e872970c9010bb23 100644
(file)
--- a/
src/journal/journal-gatewayd.c
+++ b/
src/journal/journal-gatewayd.c
@@
-131,6
+131,7
@@
static int respond_oom_internal(struct MHD_Connection *connection) {
#define respond_oom(connection) log_oom(), respond_oom_internal(connection)
#define respond_oom(connection) log_oom(), respond_oom_internal(connection)
+_printf_(3,4)
static int respond_error(
struct MHD_Connection *connection,
unsigned code,
static int respond_error(
struct MHD_Connection *connection,
unsigned code,
@@
-742,43
+743,31
@@
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;
- r = sd_bus_
open
_system(&bus);
+ r = sd_bus_
default
_system(&bus);
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;
}