#include <alloca.h>
#include <sys/types.h>
-#include "poll.h"
+
+/* Specification. */
+#include <poll.h>
+
#include <errno.h>
#include <limits.h>
#include <assert.h>
#define IsConsoleHandle(h) (((long) (h) & 3) == 3)
static BOOL
-IsSocketHandle(HANDLE h)
+IsSocketHandle (HANDLE h)
{
WSANETWORKEVENTS ev;
if (avail)
happened |= *p_sought & (POLLIN | POLLRDNORM);
}
+ else if (GetLastError () == ERROR_BROKEN_PIPE)
+ happened |= POLLHUP;
else
{
#endif /* !MinGW */
int
-poll (pfd, nfd, timeout)
- struct pollfd *pfd;
- nfds_t nfd;
- int timeout;
+poll (struct pollfd *pfd, nfds_t nfd, int timeout)
{
#ifndef WIN32_NATIVE
fd_set rfds, wfds, efds;
if (sought)
handle_array[nhandles++] = h;
if (pfd[i].revents)
- wait_timeout = 0;
+ timeout = 0;
}
}