summaryrefslogtreecommitdiff
path: root/support
diff options
context:
space:
mode:
authorBrian Havard <bjh@apache.org>2010-04-12 18:10:48 +0000
committerBrian Havard <bjh@apache.org>2010-04-12 18:10:48 +0000
commit3ae1c245c4593e92f953b1ad0d44793567281049 (patch)
treeaa98974e81186474ae15001a84d779c601e12e4a /support
parent2477f7e99d2ffc39f2ff2d47dbd02fec6db8bbc2 (diff)
downloadapr-3ae1c245c4593e92f953b1ad0d44793567281049.tar.gz
Hide apr_wait_for_io_or_timeout() from public view and add instead
apr_socket_wait() and apr_file_pipe_wait(). git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@933338 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'support')
-rw-r--r--support/os2/waitio.c41
1 files changed, 2 insertions, 39 deletions
diff --git a/support/os2/waitio.c b/support/os2/waitio.c
index e799b2711..60530e732 100644
--- a/support/os2/waitio.c
+++ b/support/os2/waitio.c
@@ -19,51 +19,14 @@
#include "apr_errno.h"
#include "apr_support.h"
-static apr_status_t wait_for_file(apr_file_t *f, int for_read)
-{
- int rc;
-
- if (!f->pipe) {
- /* No support for waiting on a regular file */
- return APR_ENOTIMPL;
- }
-
- rc = DosWaitEventSem(f->pipeSem, f->timeout >= 0 ? f->timeout / 1000 : SEM_INDEFINITE_WAIT);
-
- if (rc == ERROR_TIMEOUT) {
- return APR_TIMEUP;
- }
-
- return APR_FROM_OS_ERROR(rc);
-}
-
-
-
-static apr_status_t wait_for_socket(apr_socket_t *s, int for_read)
-{
- int pollsocket = s->socketdes;
- int wait_rc = select(&pollsocket, for_read != 0, for_read == 0, 0, s->timeout / 1000);
-
- if (wait_rc == 0) {
- return APR_TIMEUP;
- }
- else if (wait_rc < 0) {
- return APR_FROM_OS_ERROR(sock_errno());
- }
-
- return APR_SUCCESS;
-}
-
-
-
apr_status_t apr_wait_for_io_or_timeout(apr_file_t *f, apr_socket_t *s,
int for_read)
{
if (f) {
- return wait_for_file(f, for_read);
+ return apr_file_pipe_wait(f, for_read ? APR_WAIT_READ : APR_WAIT_WRITE);
}
else if (s) {
- return wait_for_socket(s, for_read);
+ return apr_socket_wait(s, for_read ? APR_WAIT_READ : APR_WAIT_WRITE);
}
/* Didn't specify a file or socket */