summaryrefslogtreecommitdiff
path: root/support/unix/waitio.c
diff options
context:
space:
mode:
Diffstat (limited to 'support/unix/waitio.c')
-rw-r--r--support/unix/waitio.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/support/unix/waitio.c b/support/unix/waitio.c
index fa5edb65e..a3c6a8349 100644
--- a/support/unix/waitio.c
+++ b/support/unix/waitio.c
@@ -42,10 +42,13 @@ apr_status_t apr_wait_for_io_or_timeout(apr_file_t *f, apr_socket_t *s,
struct pollfd pfd;
int rc, timeout;
- timeout = f ? f->timeout / 1000 : s->timeout / 1000;
+ timeout = f ? f->timeout : s->timeout;
pfd.fd = f ? f->filedes : s->socketdes;
pfd.events = for_read ? POLLIN : POLLOUT;
+ if (timeout > 0) {
+ timeout = (timeout + 999) / 1000;
+ }
do {
rc = poll(&pfd, 1, timeout);
} while (rc == -1 && errno == EINTR);