summaryrefslogtreecommitdiff
path: root/src/libsystemd-bus/bus-kernel.c
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2013-12-20 23:25:43 +0100
committerLennart Poettering <lennart@poettering.net>2013-12-20 23:26:11 +0100
commitae095f860593c87d217773976cfe5f89a6993c89 (patch)
tree5a014286ac5088e72e2044faa028962774ebcdf9 /src/libsystemd-bus/bus-kernel.c
parent5a884f93fdb2a6f89605e44a0e7f4d2db5470b5b (diff)
bus: wrap KDBUS_CMD_BYEBYE with a high-level call sd_bus_try_close()
Diffstat (limited to 'src/libsystemd-bus/bus-kernel.c')
-rw-r--r--src/libsystemd-bus/bus-kernel.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/src/libsystemd-bus/bus-kernel.c b/src/libsystemd-bus/bus-kernel.c
index 369eac468b..2802187e70 100644
--- a/src/libsystemd-bus/bus-kernel.c
+++ b/src/libsystemd-bus/bus-kernel.c
@@ -1266,3 +1266,13 @@ int bus_kernel_create_monitor(const char *bus) {
return fd;
}
+
+int bus_kernel_try_close(sd_bus *bus) {
+ assert(bus);
+ assert(bus->is_kernel);
+
+ if (ioctl(bus->input_fd, KDBUS_CMD_BYEBYE) < 0)
+ return -errno;
+
+ return 0;
+}