Commit 232337c3 authored by Rafaël Carré's avatar Rafaël Carré

Fix #1581 - Really fix #986 - rc : do not read stdin when we can't

parent 643f11c4
......@@ -140,10 +140,13 @@ void __msg_rc( intf_thread_t *p_intf, const char *psz_fmt, ... )
va_start( args, psz_fmt );
if( p_intf->p_sys->i_socket == -1 )
{
if( !p_intf->p_sys->pi_socket_listen )
{
utf8_vfprintf( stdout, psz_fmt, args );
printf( "\r\n" );
}
}
else
{
net_vaPrintf( p_intf, p_intf->p_sys->i_socket, NULL, psz_fmt, args );
......@@ -2297,6 +2300,13 @@ vlc_bool_t ReadCommand( intf_thread_t *p_intf, char *p_buffer, int *pi_size )
}
#endif
if( p_intf->p_sys->i_socket == -1 && p_intf->p_sys->pi_socket_listen )
{
/* Do not try to read stdin if we are listening on a socket */
msleep( INTF_IDLE_SLEEP );
return VLC_FALSE;
}
while( !p_intf->b_die && *pi_size < MAX_LINE_LENGTH &&
(i_read = net_ReadNonBlock( p_intf, p_intf->p_sys->i_socket == -1 ?
0 /*STDIN_FILENO*/ : p_intf->p_sys->i_socket, NULL,
......
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