From 79f35b799fec1da8122a8328c703b424118535db Mon Sep 17 00:00:00 2001 From: wrowe Date: Sat, 1 Sep 2007 07:27:07 +0000 Subject: Correctly handle completion-based read-to-EOF case. Resolves testfile, still have testpipe and testproc to contend with. Submitted by: Steven Naim Backports: r571728 git-svn-id: http://svn.apache.org/repos/asf/apr/apr/branches/0.9.x@571731 13f79535-47bb-0310-9956-ffa450edef68 --- file_io/win32/readwrite.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/file_io/win32/readwrite.c b/file_io/win32/readwrite.c index 403fa97fd..5291830aa 100644 --- a/file_io/win32/readwrite.c +++ b/file_io/win32/readwrite.c @@ -111,6 +111,9 @@ static apr_status_t read_with_timeout(apr_file_t *file, void *buf, apr_size_t le else if (rv == APR_FROM_OS_ERROR(ERROR_BROKEN_PIPE)) { /* Assume ERROR_BROKEN_PIPE signals an EOF reading from a pipe */ rv = APR_EOF; + } else if (rv == APR_FROM_OS_ERROR(ERROR_HANDLE_EOF)) { + /* Did we hit EOF reading from the handle? */ + rv = APR_EOF; } } else { /* OK and 0 bytes read ==> end of file */ -- cgit v1.2.1