projects
/
gnulib.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
maint: remove doubled words in comments, e.g., s/a a/a/
[gnulib.git]
/
lib
/
poll.c
diff --git
a/lib/poll.c
b/lib/poll.c
index
90d99d9
..
8ce68c0
100644
(file)
--- a/
lib/poll.c
+++ b/
lib/poll.c
@@
-1,7
+1,7
@@
/* Emulation for poll(2)
Contributed by Paolo Bonzini.
/* Emulation for poll(2)
Contributed by Paolo Bonzini.
- Copyright 2001-2003, 2006-201
0
Free Software Foundation, Inc.
+ Copyright 2001-2003, 2006-201
1
Free Software Foundation, Inc.
This file is part of gnulib.
This file is part of gnulib.
@@
-28,7
+28,10
@@
#include <alloca.h>
#include <sys/types.h>
#include <alloca.h>
#include <sys/types.h>
-#include "poll.h"
+
+/* Specification. */
+#include <poll.h>
+
#include <errno.h>
#include <limits.h>
#include <assert.h>
#include <errno.h>
#include <limits.h>
#include <assert.h>
@@
-70,7
+73,7
@@
#define IsConsoleHandle(h) (((long) (h) & 3) == 3)
static BOOL
#define IsConsoleHandle(h) (((long) (h) & 3) == 3)
static BOOL
-IsSocketHandle(HANDLE h)
+IsSocketHandle
(HANDLE h)
{
WSANETWORKEVENTS ev;
{
WSANETWORKEVENTS ev;
@@
-150,6
+153,8
@@
win32_compute_revents (HANDLE h, int *p_sought)
if (avail)
happened |= *p_sought & (POLLIN | POLLRDNORM);
}
if (avail)
happened |= *p_sought & (POLLIN | POLLRDNORM);
}
+ else if (GetLastError () == ERROR_BROKEN_PIPE)
+ happened |= POLLHUP;
else
{
else
{
@@
-310,10
+315,7
@@
compute_revents (int fd, int sought, fd_set *rfds, fd_set *wfds, fd_set *efds)
#endif /* !MinGW */
int
#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;
{
#ifndef WIN32_NATIVE
fd_set rfds, wfds, efds;
@@
-503,7
+505,7
@@
poll (pfd, nfd, timeout)
if (sought)
handle_array[nhandles++] = h;
if (pfd[i].revents)
if (sought)
handle_array[nhandles++] = h;
if (pfd[i].revents)
-
wait_
timeout = 0;
+ timeout = 0;
}
}
}
}