chiark
/
gitweb
/
~ianmdlvl
/
elogind.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
sd-bus: update to current kernel version, by splitting off the extended KDBUS_ITEM_PI...
[elogind.git]
/
src
/
libsystemd
/
sd-bus
/
sd-bus.c
diff --git
a/src/libsystemd/sd-bus/sd-bus.c
b/src/libsystemd/sd-bus/sd-bus.c
index c2931a7f7b09e9292cace68ad067a55d461bdf2e..5aa8eacebb61095203c40c986bb3d49fed9744f7 100644
(file)
--- a/
src/libsystemd/sd-bus/sd-bus.c
+++ b/
src/libsystemd/sd-bus/sd-bus.c
@@
-129,7
+129,7
@@
static void bus_free(sd_bus *b) {
free(b->machine);
free(b->fake_label);
free(b->cgroup_root);
free(b->machine);
free(b->fake_label);
free(b->cgroup_root);
- free(b->
connection_name
);
+ free(b->
description
);
free(b->exec_path);
strv_free(b->exec_argv);
free(b->exec_path);
strv_free(b->exec_argv);
@@
-323,22
+323,12
@@
_public_ int sd_bus_set_trusted(sd_bus *bus, int b) {
return 0;
}
return 0;
}
-_public_ int sd_bus_set_name(sd_bus *bus, const char *name) {
- char *n;
-
+_public_ int sd_bus_set_description(sd_bus *bus, const char *description) {
assert_return(bus, -EINVAL);
assert_return(bus, -EINVAL);
- assert_return(name, -EINVAL);
assert_return(bus->state == BUS_UNSET, -EPERM);
assert_return(!bus_pid_changed(bus), -ECHILD);
assert_return(bus->state == BUS_UNSET, -EPERM);
assert_return(!bus_pid_changed(bus), -ECHILD);
- n = strdup(name);
- if (!n)
- return -ENOMEM;
-
- free(bus->connection_name);
- bus->connection_name = n;
-
- return 0;
+ return free_and_strdup(&bus->description, description);
}
static int hello_callback(sd_bus *bus, sd_bus_message *reply, void *userdata, sd_bus_error *error) {
}
static int hello_callback(sd_bus *bus, sd_bus_message *reply, void *userdata, sd_bus_error *error) {
@@
-817,7
+807,7
@@
static int parse_container_kernel_address(sd_bus *b, const char **p, char **guid
machine = NULL;
free(b->kernel);
machine = NULL;
free(b->kernel);
- b->kernel = strdup("/
dev
/kdbus/0-system/bus");
+ b->kernel = strdup("/
sys/fs
/kdbus/0-system/bus");
if (!b->kernel)
return -ENOMEM;
if (!b->kernel)
return -ENOMEM;
@@
-1080,7
+1070,7
@@
_public_ int sd_bus_open(sd_bus **ret) {
/* We don't know whether the bus is trusted or not, so better
* be safe, and authenticate everything */
b->trusted = false;
/* We don't know whether the bus is trusted or not, so better
* be safe, and authenticate everything */
b->trusted = false;
- b->attach_flags |= KDBUS_ATTACH_CAPS | KDBUS_ATTACH_CREDS;
+ b->attach_flags |= KDBUS_ATTACH_CAPS | KDBUS_ATTACH_CREDS
| KDBUS_ATTACH_PIDS
;
r = sd_bus_start(b);
if (r < 0)
r = sd_bus_start(b);
if (r < 0)
@@
-1157,13
+1147,13
@@
int bus_set_address_user(sd_bus *b) {
return -ENOMEM;
#ifdef ENABLE_KDBUS
return -ENOMEM;
#ifdef ENABLE_KDBUS
- asprintf(&b->address, KERNEL_USER_BUS_FMT ";" UNIX_USER_BUS_FMT, getuid(), ee);
+
(void)
asprintf(&b->address, KERNEL_USER_BUS_FMT ";" UNIX_USER_BUS_FMT, getuid(), ee);
#else
#else
- asprintf(&b->address, UNIX_USER_BUS_FMT, ee);
+
(void)
asprintf(&b->address, UNIX_USER_BUS_FMT, ee);
#endif
} else {
#ifdef ENABLE_KDBUS
#endif
} else {
#ifdef ENABLE_KDBUS
- asprintf(&b->address, KERNEL_USER_BUS_FMT, getuid());
+
(void)
asprintf(&b->address, KERNEL_USER_BUS_FMT, getuid());
#else
return -ECONNREFUSED;
#endif
#else
return -ECONNREFUSED;
#endif
@@
-1422,18
+1412,18
@@
_public_ int sd_bus_can_send(sd_bus *bus, char type) {
return bus_type_is_valid(type);
}
return bus_type_is_valid(type);
}
-_public_ int sd_bus_get_
server_id(sd_bus *bus, sd_id128_t *server_
id) {
+_public_ int sd_bus_get_
owner_id(sd_bus *bus, sd_id128_t *
id) {
int r;
assert_return(bus, -EINVAL);
int r;
assert_return(bus, -EINVAL);
- assert_return(
server_
id, -EINVAL);
+ assert_return(id, -EINVAL);
assert_return(!bus_pid_changed(bus), -ECHILD);
r = bus_ensure_running(bus);
if (r < 0)
return r;
assert_return(!bus_pid_changed(bus), -ECHILD);
r = bus_ensure_running(bus);
if (r < 0)
return r;
- *
server_
id = bus->server_id;
+ *id = bus->server_id;
return 0;
}
return 0;
}
@@
-3015,7
+3005,7
@@
static int attach_io_events(sd_bus *bus) {
if (r < 0)
return r;
if (r < 0)
return r;
- r = sd_event_source_set_
name
(bus->input_io_event_source, "bus-input");
+ r = sd_event_source_set_
description
(bus->input_io_event_source, "bus-input");
} else
r = sd_event_source_set_io_fd(bus->input_io_event_source, bus->input_fd);
} else
r = sd_event_source_set_io_fd(bus->input_io_event_source, bus->input_fd);
@@
-3034,7
+3024,7
@@
static int attach_io_events(sd_bus *bus) {
if (r < 0)
return r;
if (r < 0)
return r;
- r = sd_event_source_set_
name
(bus->input_io_event_source, "bus-output");
+ r = sd_event_source_set_
description
(bus->input_io_event_source, "bus-output");
} else
r = sd_event_source_set_io_fd(bus->output_io_event_source, bus->output_fd);
} else
r = sd_event_source_set_io_fd(bus->output_io_event_source, bus->output_fd);
@@
-3087,7
+3077,7
@@
_public_ int sd_bus_attach_event(sd_bus *bus, sd_event *event, int priority) {
if (r < 0)
goto fail;
if (r < 0)
goto fail;
- r = sd_event_source_set_
name
(bus->time_event_source, "bus-time");
+ r = sd_event_source_set_
description
(bus->time_event_source, "bus-time");
if (r < 0)
goto fail;
if (r < 0)
goto fail;
@@
-3095,7
+3085,7
@@
_public_ int sd_bus_attach_event(sd_bus *bus, sd_event *event, int priority) {
if (r < 0)
goto fail;
if (r < 0)
goto fail;
- r = sd_event_source_set_
name
(bus->quit_event_source, "bus-exit");
+ r = sd_event_source_set_
description
(bus->quit_event_source, "bus-exit");
if (r < 0)
goto fail;
if (r < 0)
goto fail;
@@
-3322,12
+3312,13
@@
_public_ int sd_bus_try_close(sd_bus *bus) {
return 0;
}
return 0;
}
-_public_ int sd_bus_get_
name(sd_bus *bus, const char **name
) {
+_public_ int sd_bus_get_
description(sd_bus *bus, const char **description
) {
assert_return(bus, -EINVAL);
assert_return(bus, -EINVAL);
- assert_return(name, -EINVAL);
+ assert_return(description, -EINVAL);
+ assert_return(bus->description, -ENXIO);
assert_return(!bus_pid_changed(bus), -ECHILD);
assert_return(!bus_pid_changed(bus), -ECHILD);
- *
name = bus->connection_name
;
+ *
description = bus->description
;
return 0;
}
return 0;
}