chiark
/
gitweb
/
~ianmdlvl
/
elogind.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
networkd: add networkd-wait-online
[elogind.git]
/
src
/
journal
/
journal-gatewayd.c
diff --git
a/src/journal/journal-gatewayd.c
b/src/journal/journal-gatewayd.c
index 093dc74e2c7bc2d3e695d88efa586919beb697eb..7e97a3588ce09abbd18befd4f094b05a6bec887e 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;
+ char *b = NULL;
int r;
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;
}
@@
-791,7
+780,7
@@
static int request_handler_machine(
RequestMeta *m = connection_cls;
int r;
_cleanup_free_ char* hostname = NULL, *os_name = NULL;
RequestMeta *m = connection_cls;
int r;
_cleanup_free_ char* hostname = NULL, *os_name = NULL;
- uint64_t cutoff_from
, cutoff_to
, usage;
+ uint64_t cutoff_from
= 0, cutoff_to = 0
, usage;
char *json;
sd_id128_t mid, bid;
_cleanup_free_ char *v = NULL;
char *json;
sd_id128_t mid, bid;
_cleanup_free_ char *v = NULL;