[systemd-commits] 2 commits - src/libsystemd-bus
Kay Sievers
kay at kemper.freedesktop.org
Fri Apr 12 10:49:19 PDT 2013
src/libsystemd-bus/bus-kernel.c | 5 +++--
src/libsystemd-bus/test-bus-kernel.c | 2 +-
2 files changed, 4 insertions(+), 3 deletions(-)
New commits:
commit e74d860ccbe118a9b32dc6d900a5fcdd7d355c03
Author: Kay Sievers <kay at vrfy.org>
Date: Fri Apr 12 20:32:19 2013 +0200
bus: test - re-enable check for returned error
diff --git a/src/libsystemd-bus/test-bus-kernel.c b/src/libsystemd-bus/test-bus-kernel.c
index 14029ff..e84e45a 100644
--- a/src/libsystemd-bus/test-bus-kernel.c
+++ b/src/libsystemd-bus/test-bus-kernel.c
@@ -92,7 +92,7 @@ int main(int argc, char *argv[]) {
assert_se(r >= 0);
r = sd_bus_release_name(a, "net.0pointer.foobar");
- assert_se(r >= 0);
+ assert_se(r == -ENXIO);
sd_bus_unref(a);
sd_bus_unref(b);
commit 8e7382422c01dc0c19dc3c35a6144fa703ba34ee
Author: Kay Sievers <kay at vrfy.org>
Date: Fri Apr 12 20:08:28 2013 +0200
bus: align the buffer we pass to the kernel
diff --git a/src/libsystemd-bus/bus-kernel.c b/src/libsystemd-bus/bus-kernel.c
index 2b3f46a..d5152ec 100644
--- a/src/libsystemd-bus/bus-kernel.c
+++ b/src/libsystemd-bus/bus-kernel.c
@@ -109,7 +109,7 @@ static int bus_message_setup_kmsg(sd_bus_message *m) {
sz += ALIGN8(offsetof(struct kdbus_msg, data) + dl + 1);
}
- m->kdbus = malloc0(sz);
+ m->kdbus = aligned_alloc(8, sz);
if (!m->kdbus)
return -ENOMEM;
@@ -355,10 +355,11 @@ int bus_kernel_read_message(sd_bus *bus, sd_bus_message **m) {
for (;;) {
void *q;
- q = realloc(bus->rbuffer, sz);
+ q = aligned_alloc(8, sz);
if (!q)
return -errno;
+ free(bus->rbuffer);
k = bus->rbuffer = q;
k->size = sz;
More information about the systemd-commits
mailing list