summaryrefslogtreecommitdiff
path: root/src/libsystemd/sd-bus/bus-kernel.c
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2014-01-22 23:36:06 +0100
committerLennart Poettering <lennart@poettering.net>2014-01-27 20:12:59 +0100
commitff975efb2e88dcd5221a2f0d76c4c87e85b821a8 (patch)
treebd117cf5ee4e74854a590311f3190cbd66b74d6b /src/libsystemd/sd-bus/bus-kernel.c
parent82cd413782cca6de3088c2705f839ff31abec7f9 (diff)
bus: when we cannot bus activate a service because we go down, drop one
message from the queue
Diffstat (limited to 'src/libsystemd/sd-bus/bus-kernel.c')
-rw-r--r--src/libsystemd/sd-bus/bus-kernel.c13
1 files changed, 13 insertions, 0 deletions
diff --git a/src/libsystemd/sd-bus/bus-kernel.c b/src/libsystemd/sd-bus/bus-kernel.c
index a33e7a323c..b46cada648 100644
--- a/src/libsystemd/sd-bus/bus-kernel.c
+++ b/src/libsystemd/sd-bus/bus-kernel.c
@@ -1476,3 +1476,16 @@ int bus_kernel_try_close(sd_bus *bus) {
return 0;
}
+
+int bus_kernel_drop_one(int fd) {
+ struct kdbus_cmd_recv recv = {
+ .flags = KDBUS_RECV_DROP
+ };
+
+ assert(fd >= 0);
+
+ if (ioctl(fd, KDBUS_CMD_MSG_RECV, &recv) < 0)
+ return -errno;
+
+ return 0;
+}