Commit 03313741 authored by Gerard Patel's avatar Gerard Patel Committed by Alexandre Julliard

Test for ws_timeout=NULL in winsock select().

parent 01036f44
......@@ -1872,17 +1872,22 @@ static INT __ws_select(BOOL b32,
fd_set readfds, writefds, exceptfds;
fd_set *p_read, *p_write, *p_except;
int readfd[FD_SETSIZE], writefd[FD_SETSIZE], exceptfd[FD_SETSIZE];
struct timeval timeout;
struct timeval timeout, *timeoutaddr = NULL;
TRACE("read %p, write %p, excp %p\n", ws_readfds, ws_writefds, ws_exceptfds);
TRACE("read %p, write %p, excp %p timeout %p\n",
ws_readfds, ws_writefds, ws_exceptfds, ws_timeout);
p_read = fd_set_import(&readfds, ws_readfds, &highfd, readfd, b32);
p_write = fd_set_import(&writefds, ws_writefds, &highfd, writefd, b32);
p_except = fd_set_import(&exceptfds, ws_exceptfds, &highfd, exceptfd, b32);
if (ws_timeout)
{
timeoutaddr = &timeout;
timeout.tv_sec=ws_timeout->tv_sec;
timeout.tv_usec=ws_timeout->tv_usec;
}
if( (highfd = select(highfd + 1, p_read, p_write, p_except, &timeout)) > 0 )
if( (highfd = select(highfd + 1, p_read, p_write, p_except, timeoutaddr)) > 0 )
{
fd_set_export(&readfds, p_except, ws_readfds, readfd, b32);
fd_set_export(&writefds, p_except, ws_writefds, writefd, b32);
......
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