# HG changeset patch # User reimar # Date 1190206868 0 # Node ID 7b6a3948f5f2ea70d1f1e862221f7e5141025e0a # Parent 97eaba07ef9d6459f1e30397f0c44b93adde50ab (Re)move idiotic checks, ret can't be < 0 or > 0 if the loop condition is that it is == 0! diff -r 97eaba07ef9d -r 7b6a3948f5f2 stream/tcp.c --- a/stream/tcp.c Wed Sep 19 12:54:10 2007 +0000 +++ b/stream/tcp.c Wed Sep 19 13:01:08 2007 +0000 @@ -195,9 +195,7 @@ FD_SET( socket_server_fd, &set ); // When the connection will be made, we will have a writeable fd while((ret = select(socket_server_fd+1, NULL, &set, NULL, &tv)) == 0) { - if( ret<0 ) mp_msg(MSGT_NETWORK,MSGL_ERR,MSGTR_MPDEMUX_NW_SelectFailed); - else if(ret > 0) break; - else if(count > 30 || mp_input_check_interrupt(500)) { + if(count > 30 || mp_input_check_interrupt(500)) { if(count > 30) mp_msg(MSGT_NETWORK,MSGL_ERR,MSGTR_MPDEMUX_NW_ConnTimeout); else @@ -210,6 +208,7 @@ tv.tv_sec = 0; tv.tv_usec = 500000; } + if (ret < 0) mp_msg(MSGT_NETWORK,MSGL_ERR,MSGTR_MPDEMUX_NW_SelectFailed); // Turn back the socket as blocking #ifndef HAVE_WINSOCK2