summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorbrianp <brianp@13f79535-47bb-0310-9956-ffa450edef68>2002-08-02 05:07:16 +0000
committerbrianp <brianp@13f79535-47bb-0310-9956-ffa450edef68>2002-08-02 05:07:16 +0000
commit90b20fc089e8ac32304f89cbbb739c4340edd77e (patch)
tree5c935318e1004f305aba3f099047ed4bc6002185
parent1e05cab398ab0fb490b36e18f3ba07d2cd3caed6 (diff)
downloadlibapr-90b20fc089e8ac32304f89cbbb739c4340edd77e.tar.gz
Avoid trying to turn file handles into sockets on win32 (where
they're not interchangeable) git-svn-id: http://svn.apache.org/repos/asf/apr/apr/trunk@63760 13f79535-47bb-0310-9956-ffa450edef68
-rw-r--r--poll/unix/poll.c16
1 files changed, 14 insertions, 2 deletions
diff --git a/poll/unix/poll.c b/poll/unix/poll.c
index 8a68d8c6b..37b834dce 100644
--- a/poll/unix/poll.c
+++ b/poll/unix/poll.c
@@ -197,10 +197,14 @@ APR_DECLARE(apr_status_t) apr_poll(apr_pollfd_t *aprset, int num, apr_int32_t *n
fd = aprset[i].desc.s->socketdes;
}
else if (aprset[i].desc_type == APR_POLL_FILE) {
+#ifdef WIN32
+ return APR_EBADF;
+#else
fd = aprset[i].desc.f->filedes;
#ifdef NETWARE
is_pipe = aprset[i].desc.f->is_pipe;
-#endif
+#endif /* NETWARE */
+#endif /* !WIN32 */
}
if (aprset[i].reqevents & APR_POLLIN) {
FD_SET(fd, &readset);
@@ -249,7 +253,11 @@ APR_DECLARE(apr_status_t) apr_poll(apr_pollfd_t *aprset, int num, apr_int32_t *n
fd = aprset[i].desc.s->socketdes;
}
else {
+#ifdef WIN32
+ return EBADF;
+#else
fd = aprset[i].desc.f->filedes;
+#endif
}
aprset[i].rtnevents = 0;
if (FD_ISSET(fd, &readset)) {
@@ -509,7 +517,11 @@ APR_DECLARE(apr_status_t) apr_pollset_poll(apr_pollset_t *pollset,
fd = pollset->query_set[i].desc.s->socketdes;
}
else {
- fd = pollset->query_set[i].desc.s->socketdes;
+#ifdef WIN32
+ return APR_EBADF;
+#else
+ fd = pollset->query_set[i].desc.f->filedes;
+#endif
}
if (FD_ISSET(fd, &readset) || FD_ISSET(fd, &writeset) ||
FD_ISSET(fd, &exceptset)) {