From: Guillaume Desmottes Date: Thu, 5 Apr 2018 10:19:39 +0000 (+0200) Subject: poll: stop treating on POLLPRI as 'read' X-Git-Tag: 1.16.2~360 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=1e321eb51f225e0685ed8d10c9d8515d7b66c01b;p=platform%2Fupstream%2Fgstreamer.git poll: stop treating on POLLPRI as 'read' Current code was considering "can read" as having either POLLIN or POLLPRI being set. This may lead to client being awaken because of POLLPRI, starting a blocking read and getting stuck because there is actually nothing to read. This patch removes POLLPRI handling in read code and I'll add specific API to wait for POLLPRI. https://bugzilla.gnome.org/show_bug.cgi?id=794977 --- diff --git a/gst/gstpoll.c b/gst/gstpoll.c index fd672ed..1cc17d1 100644 --- a/gst/gstpoll.c +++ b/gst/gstpoll.c @@ -1021,9 +1021,9 @@ gst_poll_fd_ctl_read_unlocked (GstPoll * set, GstPollFD * fd, gboolean active) struct pollfd *pfd = &g_array_index (set->fds, struct pollfd, idx); if (active) - pfd->events |= (POLLIN | POLLPRI); + pfd->events |= POLLIN; else - pfd->events &= ~(POLLIN | POLLPRI); + pfd->events &= ~POLLIN; #else gst_poll_update_winsock_event_mask (set, idx, FD_READ | FD_ACCEPT, active); #endif @@ -1201,7 +1201,7 @@ gst_poll_fd_can_read_unlocked (const GstPoll * set, GstPollFD * fd) #ifndef G_OS_WIN32 struct pollfd *pfd = &g_array_index (set->active_fds, struct pollfd, idx); - res = (pfd->revents & (POLLIN | POLLPRI)) != 0; + res = (pfd->revents & POLLIN) != 0; #else WinsockFd *wfd = &g_array_index (set->active_fds, WinsockFd, idx);