[vlc-commits] DVB CAM: don't choke on EINTR
Rémi Denis-Courmont
git at videolan.org
Sun Jan 23 17:02:34 CET 2011
vlc/vlc-1.1 | branch: master | Rémi Denis-Courmont <remi at remlab.net> | Sun Jan 23 17:34:17 2011 +0200| [059e3fc52867b8fee135b06cc4b6ad3a3f939c1e] | committer: Rémi Denis-Courmont
DVB CAM: don't choke on EINTR
(cherry picked from commit d8ddcbff798c8927bdc2656a74a5862386320ee9)
> http://git.videolan.org/gitweb.cgi/vlc/vlc-1.1.git/?a=commit;h=059e3fc52867b8fee135b06cc4b6ad3a3f939c1e
---
modules/access/dvb/en50221.c | 12 ++++++++++--
1 files changed, 10 insertions(+), 2 deletions(-)
diff --git a/modules/access/dvb/en50221.c b/modules/access/dvb/en50221.c
index 6a24fce..b44ac11 100644
--- a/modules/access/dvb/en50221.c
+++ b/modules/access/dvb/en50221.c
@@ -261,9 +261,17 @@ static int TPDURecv( access_t * p_access, uint8_t i_slot, uint8_t *pi_tag,
pfd[0].fd = p_sys->i_ca_handle;
pfd[0].events = POLLIN;
- if ( !(poll(pfd, 1, CAM_READ_TIMEOUT) > 0 && (pfd[0].revents & POLLIN)) )
+
+ while( poll(pfd, 1, CAM_READ_TIMEOUT ) == -1 )
+ if( errno != EINTR )
+ {
+ msg_Err( p_access, "poll error: %m" );
+ return VLC_EGENERIC;
+ }
+
+ if ( !(pfd[0].revents & POLLIN) )
{
- msg_Err( p_access, "cannot poll from CAM device" );
+ msg_Err( p_access, "CAM device poll time-out" );
return VLC_EGENERIC;
}
More information about the vlc-commits
mailing list