]> git.sesse.net Git - vlc/commitdiff
DVB CAM: don't choke on EINTR
authorRémi Denis-Courmont <remi@remlab.net>
Sun, 23 Jan 2011 15:34:17 +0000 (17:34 +0200)
committerRémi Denis-Courmont <remi@remlab.net>
Sun, 23 Jan 2011 15:48:08 +0000 (17:48 +0200)
modules/access/dvb/en50221.c

index 8e5bfd9d7473d625b772788cd3a7a97b923142e0..072d5b3931e39e974eb93ef9c2bec768c39333a3 100644 (file)
@@ -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;
     }