]> git.sesse.net Git - vlc/commitdiff
Reverts 21658 as it's totally wrong
authorRafaël Carré <funman@videolan.org>
Sat, 1 Sep 2007 14:45:29 +0000 (14:45 +0000)
committerRafaël Carré <funman@videolan.org>
Sat, 1 Sep 2007 14:45:29 +0000 (14:45 +0000)
modules/control/rc.c

index c4631100c1ea31e89caeaf24c35b53fe4b642831..f0b0514e3cead752975b407dd69f5a6ad7bf407e 100644 (file)
@@ -31,7 +31,6 @@
 #include <errno.h>                                                 /* ENOMEM */
 #include <ctype.h>
 #include <signal.h>
-#include <poll.h>
 
 #include <vlc_interface.h>
 #include <vlc_aout.h>
@@ -1943,32 +1942,19 @@ vlc_bool_t ReadCommand( intf_thread_t *p_intf, char *p_buffer, int *pi_size )
     }
 #endif
 
-    struct pollfd fds;
-    fds.fd = p_intf->p_sys->i_socket == -1 ?
-                           0 /*STDIN_FILENO*/ : p_intf->p_sys->i_socket;
-    fds.events = POLLIN;
-    i_read = 0;
-    while( !intf_ShouldDie( p_intf ) && *pi_size < MAX_LINE_LENGTH
-                                     && i_read >= 0 )
-    {
-        int i_poll = poll( &fds, 1, INTF_IDLE_SLEEP / 1000 );
-        if( i_poll == 1 )
-        {
-        
-            i_read = net_Read( p_intf, p_intf->p_sys->i_socket == -1 ?
+    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 );
-            if( p_buffer[ *pi_size ] == '\r' || p_buffer[ *pi_size ] == '\n' )
-                break;
-
-            (*pi_size)++;
-        }
-        else if ( i_poll < 0 )
+                  (uint8_t *)p_buffer + *pi_size, 1, VLC_FALSE ) ) > 0 )
+    {
+        if( p_buffer[ *pi_size ] == '\r' || p_buffer[ *pi_size ] == '\n' )
             break;
+
+        (*pi_size)++;
     }
 
     /* Connection closed */
-    if( i_read < 0 )
+    if( i_read <= 0 )
     {
         if( p_intf->p_sys->i_socket != -1 )
         {