summaryrefslogtreecommitdiff
path: root/src/libsystemd-bus/bus-internal.h
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2013-05-17 02:22:37 +0200
committerLennart Poettering <lennart@poettering.net>2013-05-17 04:26:27 +0200
commitf54514f3542db9b1f1a6f7546472718ce0d02aae (patch)
tree5aca2b916d9d91f87b60b8ec57035f7d53900593 /src/libsystemd-bus/bus-internal.h
parent8fd57568e6e82aafe153ec1f34cca36c9ccee455 (diff)
bus: keep kernel bus fd around during entire life-time of bus
We need this since we might need to invoke the release ioctl for messages. Since we don't want to add any locking for that we simply keep a reference to the bus and then rely that the fd stays valid all the time.
Diffstat (limited to 'src/libsystemd-bus/bus-internal.h')
-rw-r--r--src/libsystemd-bus/bus-internal.h7
1 files changed, 6 insertions, 1 deletions
diff --git a/src/libsystemd-bus/bus-internal.h b/src/libsystemd-bus/bus-internal.h
index 0edb09764a..5ba32ad8fd 100644
--- a/src/libsystemd-bus/bus-internal.h
+++ b/src/libsystemd-bus/bus-internal.h
@@ -68,9 +68,14 @@ enum bus_state {
BUS_OPENING,
BUS_AUTHENTICATING,
BUS_HELLO,
- BUS_RUNNING
+ BUS_RUNNING,
+ BUS_CLOSED
};
+static inline bool BUS_IS_OPEN(enum bus_state state) {
+ return state > BUS_UNSET && state < BUS_CLOSED;
+}
+
enum bus_auth {
_BUS_AUTH_INVALID,
BUS_AUTH_EXTERNAL,