summaryrefslogtreecommitdiff
path: root/src/libsystemd-bus/sd-event.c
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2013-11-11 22:00:48 +0100
committerLennart Poettering <lennart@poettering.net>2013-11-12 00:12:43 +0100
commit76b543756ef69ce69784d571aefe8de65eaeb331 (patch)
tree092b117494d53fe09a9de227009d60d94d781659 /src/libsystemd-bus/sd-event.c
parentafc6adb5ec7e73bc13156c43f52fb015cd80cc68 (diff)
bus: introduce concept of a default bus for each thread and make use of it everywhere
We want to emphasize bus connections as per-thread communication primitives, hence introduce a concept of a per-thread default bus, and make use of it everywhere.
Diffstat (limited to 'src/libsystemd-bus/sd-event.c')
-rw-r--r--src/libsystemd-bus/sd-event.c10
1 files changed, 7 insertions, 3 deletions
diff --git a/src/libsystemd-bus/sd-event.c b/src/libsystemd-bus/sd-event.c
index 8025d24bb7..0996316986 100644
--- a/src/libsystemd-bus/sd-event.c
+++ b/src/libsystemd-bus/sd-event.c
@@ -1906,8 +1906,12 @@ _public_ int sd_event_default(sd_event **ret) {
_public_ int sd_event_get_tid(sd_event *e, pid_t *tid) {
assert_return(e, -EINVAL);
assert_return(tid, -EINVAL);
- assert_return(e->tid != 0, -ENXIO);
+ assert_return(!event_pid_changed(e), -ECHILD);
- *tid = e->tid;
- return 0;
+ if (e->tid != 0) {
+ *tid = e->tid;
+ return 0;
+ }
+
+ return -ENXIO;
}