aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorMattias Andrée <maandree@operamail.com>2015-04-26 23:49:53 +0200
committerMattias Andrée <maandree@operamail.com>2015-04-26 23:49:53 +0200
commitd4971502588558cd3ee8e1243962e5782ea42d3f (patch)
tree381529b326a19d8823d60805ff21db3fb2d415ea /src
parentm (diff)
downloadbus-d4971502588558cd3ee8e1243962e5782ea42d3f.tar.gz
bus-d4971502588558cd3ee8e1243962e5782ea42d3f.tar.bz2
bus-d4971502588558cd3ee8e1243962e5782ea42d3f.tar.xz
derp
Signed-off-by: Mattias Andrée <maandree@operamail.com>
Diffstat (limited to 'src')
-rw-r--r--src/bus.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/bus.c b/src/bus.c
index cf5cec0..220b486 100644
--- a/src/bus.c
+++ b/src/bus.c
@@ -685,13 +685,14 @@ bus_poll_stop(const bus_t *bus)
const char *
bus_poll(bus_t *bus)
{
- if (bus->first_poll) {
- bus->first_poll = 0;
+ if (!bus->first_poll) {
t(release_semaphore(bus, W, SEM_UNDO));
t(acquire_semaphore(bus, S, SEM_UNDO));
t(zero_semaphore(bus, S));
t(release_semaphore(bus, S, SEM_UNDO));
t(acquire_semaphore(bus, W, SEM_UNDO));
+ } else {
+ bus->first_poll = 0;
}
t(release_semaphore(bus, Q, 0));
t(zero_semaphore(bus, Q));