/* Emulation for select(2)
Contributed by Paolo Bonzini.
- Copyright 2008-2009 Free Software Foundation, Inc.
+ Copyright 2008-2011 Free Software Foundation, Inc.
This file is part of gnulib.
#define IsConsoleHandle(h) (((long) (h) & 3) == 3)
static BOOL
-IsSocketHandle(HANDLE h)
+IsSocketHandle (HANDLE h)
{
WSANETWORKEVENTS ev;
if (avail)
read = TRUE;
}
+ else if (GetLastError () == ERROR_BROKEN_PIPE)
+ ;
else
{
wait_timeout = INFINITE;
else
{
- wait_timeout = timeout->tv_sec + timeout->tv_usec / 1000;
+ wait_timeout = timeout->tv_sec * 1000 + timeout->tv_usec / 1000;
/* select is also used as a portable usleep. */
if (!rfds && !wfds && !xfds)