[systemd-commits] 4 commits - src/libsystemd-bus
Lennart Poettering
lennart at kemper.freedesktop.org
Thu Apr 11 15:44:36 PDT 2013
src/libsystemd-bus/bus-kernel.c | 7 +++++--
src/libsystemd-bus/test-bus-kernel.c | 9 ++++++---
2 files changed, 11 insertions(+), 5 deletions(-)
New commits:
commit 296f3c53cb4a87e297c019475f900fb3cca2d781
Author: Lennart Poettering <lennart at poettering.net>
Date: Fri Apr 12 00:43:57 2013 +0200
bus: fix formatting of bus address
diff --git a/src/libsystemd-bus/test-bus-kernel.c b/src/libsystemd-bus/test-bus-kernel.c
index 143b9d5..2241e65 100644
--- a/src/libsystemd-bus/test-bus-kernel.c
+++ b/src/libsystemd-bus/test-bus-kernel.c
@@ -36,7 +36,7 @@ int main(int argc, char *argv[]) {
bus_ref = bus_kernel_create("deine-mutter", &bus_name);
assert_se(bus_ref >= 0);
- address = strappend("kernel:", bus_name);
+ address = strappend("kernel:path=", bus_name);
assert_se(address);
r = sd_bus_new(&a);
@@ -60,12 +60,15 @@ int main(int argc, char *argv[]) {
r = sd_bus_get_unique_name(a, &ua);
assert_se(r >= 0);
- printf("unique a: %s", ua);
+ printf("unique a: %s\n", ua);
r = sd_bus_get_unique_name(b, &ub);
assert_se(r >= 0);
- printf("unique b: %s", ub);
+ printf("unique b: %s\n", ub);
+
+ sd_bus_unref(a);
+ sd_bus_unref(b);
return 0;
}
commit b4da2689995b72fa32c3ba6555c6c3a3f6dce5e2
Author: Lennart Poettering <lennart at poettering.net>
Date: Fri Apr 12 00:43:42 2013 +0200
bus: fix kdbus ioctl invocation
diff --git a/src/libsystemd-bus/bus-kernel.c b/src/libsystemd-bus/bus-kernel.c
index b53c5ed..e5e3536 100644
--- a/src/libsystemd-bus/bus-kernel.c
+++ b/src/libsystemd-bus/bus-kernel.c
@@ -378,7 +378,7 @@ int bus_kernel_create(const char *name, char **s) {
if (!p)
return -ENOMEM;
- if (ioctl(fd, KDBUS_CMD_BUS_MAKE, &fname) < 0) {
+ if (ioctl(fd, KDBUS_CMD_BUS_MAKE, fname) < 0) {
close_nointr_nofail(fd);
free(p);
return -errno;
commit c320885c9f16f622a9b48f529386482c76daa86c
Author: Lennart Poettering <lennart at poettering.net>
Date: Fri Apr 12 00:43:29 2013 +0200
bus: properly check if kdbus connection worked
diff --git a/src/libsystemd-bus/bus-kernel.c b/src/libsystemd-bus/bus-kernel.c
index 65b8b7b..b53c5ed 100644
--- a/src/libsystemd-bus/bus-kernel.c
+++ b/src/libsystemd-bus/bus-kernel.c
@@ -175,7 +175,7 @@ int bus_kernel_connect(sd_bus *b) {
assert(b->kernel);
b->input_fd = open(b->kernel, O_RDWR|O_NOCTTY|O_CLOEXEC);
- if (b->input_fd)
+ if (b->input_fd < 0)
return -errno;
b->output_fd = b->input_fd;
commit de2975759deb218144ed949fb42eccb33b752826
Author: Lennart Poettering <lennart at poettering.net>
Date: Fri Apr 12 00:43:12 2013 +0200
bus: fill in unique name when using kdbus
diff --git a/src/libsystemd-bus/bus-kernel.c b/src/libsystemd-bus/bus-kernel.c
index c10fcc5..65b8b7b 100644
--- a/src/libsystemd-bus/bus-kernel.c
+++ b/src/libsystemd-bus/bus-kernel.c
@@ -156,6 +156,9 @@ int bus_kernel_take_fd(sd_bus *b) {
if (r < 0)
return -errno;
+ if (asprintf(&b->unique_name, ":1.%llu", (unsigned long long) hello.id) < 0)
+ return -ENOMEM;
+
b->is_kernel = true;
r = bus_start_running(b);
More information about the systemd-commits
mailing list