pulse: handle EINTR from the custom poll function

This commit is contained in:
Wim Taymans 2020-11-02 16:45:49 +01:00
parent c43026d93e
commit b59eff4c29

View file

@ -340,9 +340,11 @@ int pa_mainloop_poll(pa_mainloop *m)
fds[0].events = POLLIN; fds[0].events = POLLIN;
fds[0].revents = 0; fds[0].revents = 0;
do {
res = m->poll_func(fds, 1, res = m->poll_func(fds, 1,
usec_to_timeout(m->timeout), usec_to_timeout(m->timeout),
m->poll_func_userdata); m->poll_func_userdata);
} while (res == -EINTR);
do_iterate = res == 1 && SPA_FLAG_IS_SET(fds[0].revents, POLLIN); do_iterate = res == 1 && SPA_FLAG_IS_SET(fds[0].revents, POLLIN);
timeout = 0; timeout = 0;
} else { } else {
@ -357,11 +359,6 @@ int pa_mainloop_poll(pa_mainloop *m)
} while (res == -EINTR); } while (res == -EINTR);
pw_loop_leave(m->loop); pw_loop_leave(m->loop);
} }
if (res < 0) {
if (res == -EINTR)
res = 0;
}
m->n_events = res; m->n_events = res;
return res; return res;
} }