From d10cd7083a59fe3e2f1035f2601822bcf6f6d338 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Rafa=C3=ABl=20Carr=C3=A9?= Date: Mon, 1 Oct 2007 00:33:08 +0000 Subject: [PATCH] That shouldn't have been part of the previous commit --- modules/control/rc.c | 25 +++++++------------------ src/network/io.c | 2 -- 2 files changed, 7 insertions(+), 20 deletions(-) diff --git a/modules/control/rc.c b/modules/control/rc.c index 80f230021d..48ae3bb178 100644 --- a/modules/control/rc.c +++ b/modules/control/rc.c @@ -1941,26 +1941,15 @@ vlc_bool_t ReadCommand( intf_thread_t *p_intf, char *p_buffer, int *pi_size ) } #endif - int i_socket = p_intf->p_sys->i_socket == -1 ? 0 : p_intf->p_sys->i_socket; - /* 0 == STDIN_FILENO */ - - while( !intf_ShouldDie( p_intf ) && *pi_size < MAX_LINE_LENGTH ) + while( !intf_ShouldDie( p_intf ) && *pi_size < MAX_LINE_LENGTH && + (i_read = net_Read( p_intf, p_intf->p_sys->i_socket == -1 ? + 0 /*STDIN_FILENO*/ : p_intf->p_sys->i_socket, NULL, + (uint8_t *)p_buffer + *pi_size, 1, VLC_FALSE ) ) > 0 ) { - i_read = net_Read( p_intf, i_socket, NULL, - (uint8_t *)p_buffer + *pi_size, 1, VLC_FALSE ); - - if( i_read > 0 ) - { - if( p_buffer[ *pi_size ] == '\r' || p_buffer[ *pi_size ] == '\n' ) - break; - - (*pi_size)++; - } - else if( i_read == 0 ) - break; - else if( errno != EINTR ) - /* we try again if a system call was interrupted */ + if( p_buffer[ *pi_size ] == '\r' || p_buffer[ *pi_size ] == '\n' ) break; + + (*pi_size)++; } /* Connection closed */ diff --git a/src/network/io.c b/src/network/io.c index 62e9e7164e..cfcec6b1f4 100644 --- a/src/network/io.c +++ b/src/network/io.c @@ -267,8 +267,6 @@ net_ReadInner (vlc_object_t *restrict p_this, unsigned fdc, const int *fdv, #if defined(WIN32) || defined(UNDER_CE) WSASetLastError (WSAEINTR); #else - if( p_this->b_die ) printf("b_die\n"); - else printf("p_libvlc->b_die\n"); errno = EINTR; #endif goto error; -- 2.39.5