[vlc-commits] DVB CAM: don't choke on EINTR

Rémi Denis-Courmont git at videolan.org
Sun Jan 23 16:49:20 CET 2011


vlc | branch: master | Rémi Denis-Courmont <remi at remlab.net> | Sun Jan 23 17:34:17 2011 +0200| [d8ddcbff798c8927bdc2656a74a5862386320ee9] | committer: Rémi Denis-Courmont

DVB CAM: don't choke on EINTR

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=d8ddcbff798c8927bdc2656a74a5862386320ee9
---

 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 8e5bfd9..072d5b3 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