stoddard 99/11/01 14:16:56
Modified: src/lib/apr/file_io/win32 readwrite.c
Log:
Make the assumption that a broken pipe signals an EOF condition. If EOF,
return APR_SUCCESS and 0 bytes read
Revision Changes Path
1.7 +8 -1 apache-2.0/src/lib/apr/file_io/win32/readwrite.c
Index: readwrite.c
===================================================================
RCS file: /home/cvs/apache-2.0/src/lib/apr/file_io/win32/readwrite.c,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -r1.6 -r1.7
--- readwrite.c 1999/10/12 11:48:23 1.6
+++ readwrite.c 1999/11/01 22:16:51 1.7
@@ -76,8 +76,15 @@
*nbytes = bread;
return APR_SUCCESS;
}
- *nbytes = -1;
+
lasterror = GetLastError();
+ if (lasterror == ERROR_BROKEN_PIPE) {
+ /* Assume ERROR_BROKEN_PIPE signals an EOF reading from a pipe */
+ *nbytes = 0;
+ return APR_SUCCESS;
+ }
+ *nbytes = -1;
+
return APR_EEXIST;
}