summaryrefslogtreecommitdiff
path: root/file_io
diff options
context:
space:
mode:
authortrawick <trawick@13f79535-47bb-0310-9956-ffa450edef68>2000-06-19 13:54:49 +0000
committertrawick <trawick@13f79535-47bb-0310-9956-ffa450edef68>2000-06-19 13:54:49 +0000
commit81c810d29d97a6dd96b2ccadc797d04042a5f49e (patch)
tree9785221eba9c61e350d5b7a555103d90d6d36b49 /file_io
parent9e4698d5a2de3c02bbf3dbb8e630b7717e08d48f (diff)
downloadlibapr-81c810d29d97a6dd96b2ccadc797d04042a5f49e.tar.gz
win32/pipe.c:
clean up some error handling logic: on Win9x, return APR_ENOTIMPL instead of APR_SUCCESS from ap_set_pipe_timeout() test/testpipe.c: don't use perror() to report an APR error git-svn-id: http://svn.apache.org/repos/asf/apr/apr/trunk@60225 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'file_io')
-rw-r--r--file_io/win32/pipe.c15
1 files changed, 12 insertions, 3 deletions
diff --git a/file_io/win32/pipe.c b/file_io/win32/pipe.c
index d967c9ca6..167cf7a72 100644
--- a/file_io/win32/pipe.c
+++ b/file_io/win32/pipe.c
@@ -73,7 +73,6 @@ ap_status_t ap_set_pipe_timeout(ap_file_t *thepipe, ap_interval_time_t timeout)
* (which support nonblocking I/O) on Windows NT.
*/
if (thepipe->pipe == 1) {
- thepipe->timeout = timeout;
if (ap_get_oslevel(thepipe->cntxt, &oslevel) == APR_SUCCESS &&
oslevel >= APR_WIN_NT) {
if (timeout == 0) {
@@ -81,9 +80,19 @@ ap_status_t ap_set_pipe_timeout(ap_file_t *thepipe, ap_interval_time_t timeout)
} else {
dwMode = PIPE_WAIT;
}
- SetNamedPipeHandleState(thepipe->filehand, &dwMode, NULL, NULL);
+ if (SetNamedPipeHandleState(thepipe->filehand, &dwMode, NULL, NULL)) {
+ thepipe->timeout = timeout;
+ return APR_SUCCESS;
+ }
+ else {
+ return GetLastError();
+ }
+ }
+ else {
+ /* can't make anonymous pipes non-blocking on Win9x
+ */
+ return APR_ENOTIMPL;
}
- return APR_SUCCESS;
}
return APR_EINVAL;
}