summaryrefslogtreecommitdiff
path: root/src/libsystemd-bus/bus-kernel.c
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2013-04-17 18:45:45 +0200
committerLennart Poettering <lennart@poettering.net>2013-04-17 18:48:31 +0200
commitc556fe792d4075a365b276e51666a8009d7dca19 (patch)
treefb8ee66ac4292ef49388a150d359939d957648cf /src/libsystemd-bus/bus-kernel.c
parent05b9b83ad3a990f1bbe417c8da377874e1e80539 (diff)
bus: replace aligned_alloc() with memalign() everywhere
aligned_alloc() is C11 and not available everywhere. Also it would require us to align the size value. So let's just invoke memalign() instead, which is universally available and doesn't have any alignment restrictions on the size parameter.
Diffstat (limited to 'src/libsystemd-bus/bus-kernel.c')
-rw-r--r--src/libsystemd-bus/bus-kernel.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/libsystemd-bus/bus-kernel.c b/src/libsystemd-bus/bus-kernel.c
index 086877eb86..2bb1b9a19a 100644
--- a/src/libsystemd-bus/bus-kernel.c
+++ b/src/libsystemd-bus/bus-kernel.c
@@ -24,6 +24,7 @@
#endif
#include <fcntl.h>
+#include <malloc.h>
#include "util.h"
@@ -199,7 +200,7 @@ static int bus_message_setup_kmsg(sd_bus *b, sd_bus_message *m) {
sz += ALIGN8(offsetof(struct kdbus_msg_item, str) + dl + 1);
}
- m->kdbus = aligned_alloc(8, sz);
+ m->kdbus = memalign(8, sz);
if (!m->kdbus)
return -ENOMEM;
@@ -500,7 +501,7 @@ int bus_kernel_read_message(sd_bus *bus, sd_bus_message **m) {
for (;;) {
void *q;
- q = aligned_alloc(8, sz);
+ q = memalign(8, sz);
if (!q)
return -errno;