diff options
author | Tanu Kaskinen <tanu.kaskinen@digia.com> | 2012-04-02 15:01:04 +0300 |
---|---|---|
committer | Tanu Kaskinen <tanuk@iki.fi> | 2012-12-19 12:31:47 +0200 |
commit | 7e94a03e0c575726a21740b0f0cfdd6196eb40cb (patch) | |
tree | 1693fcbc4dc4d0777dc3cd5588a4afb8a5665358 /src/pulse | |
parent | 31d905aaae738969e9d63b8fb46ef92259fffbf0 (diff) | |
download | pulseaudio-7e94a03e0c575726a21740b0f0cfdd6196eb40cb.tar.gz |
mainloop: Remove redundant wakeup_pipe validity checks.
The pipe is opened when creating the mainloop and closed
when freeing the mainloop. The pipe fds can never be less
than zero.
Diffstat (limited to 'src/pulse')
-rw-r--r-- | src/pulse/mainloop.c | 21 |
1 files changed, 7 insertions, 14 deletions
diff --git a/src/pulse/mainloop.c b/src/pulse/mainloop.c index aec082c05..f13c0f8e6 100644 --- a/src/pulse/mainloop.c +++ b/src/pulse/mainloop.c @@ -611,13 +611,11 @@ static void rebuild_pollfds(pa_mainloop *m) { m->n_pollfds = 0; p = m->pollfds; - if (m->wakeup_pipe[0] >= 0) { - m->pollfds[0].fd = m->wakeup_pipe[0]; - m->pollfds[0].events = POLLIN; - m->pollfds[0].revents = 0; - p++; - m->n_pollfds++; - } + m->pollfds[0].fd = m->wakeup_pipe[0]; + m->pollfds[0].events = POLLIN; + m->pollfds[0].revents = 0; + p++; + m->n_pollfds++; PA_LLIST_FOREACH(e, m->io_events) { if (e->dead) { @@ -772,10 +770,8 @@ void pa_mainloop_wakeup(pa_mainloop *m) { char c = 'W'; pa_assert(m); - if (m->wakeup_pipe[1] >= 0) { - pa_write(m->wakeup_pipe[1], &c, sizeof(c), &m->wakeup_pipe_type); - pa_atomic_store(&m->wakeup_requested, TRUE); - } + pa_write(m->wakeup_pipe[1], &c, sizeof(c), &m->wakeup_pipe_type); + pa_atomic_store(&m->wakeup_requested, TRUE); } static void clear_wakeup(pa_mainloop *m) { @@ -783,9 +779,6 @@ static void clear_wakeup(pa_mainloop *m) { pa_assert(m); - if (m->wakeup_pipe[0] < 0) - return; - if (pa_atomic_cmpxchg(&m->wakeup_requested, TRUE, FALSE)) { while (pa_read(m->wakeup_pipe[0], &c, sizeof(c), &m->wakeup_pipe_type) == sizeof(c)) ; |