Commit c55bcff9 authored by Rémi Denis-Courmont's avatar Rémi Denis-Courmont

Interrupt blocking socket reads

parent cc1791f3
...@@ -169,6 +169,12 @@ net_ReadInner( vlc_object_t *restrict p_this, unsigned fdc, const int *fdv, ...@@ -169,6 +169,12 @@ net_ReadInner( vlc_object_t *restrict p_this, unsigned fdc, const int *fdv,
if( (wait_ms != -1) && (wait_ms < 500) ) if( (wait_ms != -1) && (wait_ms < 500) )
delay_ms = wait_ms; delay_ms = wait_ms;
if( p_this->b_die )
{
errno = EINTR;
goto error;
}
#ifdef HAVE_POLL #ifdef HAVE_POLL
memset(ufd, 0, sizeof (ufd) ); memset(ufd, 0, sizeof (ufd) );
...@@ -178,10 +184,7 @@ net_ReadInner( vlc_object_t *restrict p_this, unsigned fdc, const int *fdv, ...@@ -178,10 +184,7 @@ net_ReadInner( vlc_object_t *restrict p_this, unsigned fdc, const int *fdv,
ufd[i].events = POLLIN; ufd[i].events = POLLIN;
} }
if( p_this->b_die ) n = poll( ufd, fdc, delay_ms );
return i_total;
n = poll( ufd, fdc, (wait_ms == -1) ? -1 : delay_ms );
if( n == -1 ) if( n == -1 )
goto error; goto error;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment