bjh 2003/01/02 01:52:19
Modified: file_io/os2 readwrite.c
Log:
OS/2: Return APR_TIMEUP from apr_file_read() when a pipe times out.
Was returning the "no data" error code.
Revision Changes Path
1.54 +6 -1 apr/file_io/os2/readwrite.c
Index: readwrite.c
===================================================================
RCS file: /home/cvs/apr/file_io/os2/readwrite.c,v
retrieving revision 1.53
retrieving revision 1.54
diff -u -r1.53 -r1.54
--- readwrite.c 1 Jan 2003 00:01:43 -0000 1.53
+++ readwrite.c 2 Jan 2003 09:52:19 -0000 1.54
@@ -127,8 +127,13 @@
if (rc == ERROR_NO_DATA && thefile->timeout != 0) {
int rcwait = DosWaitEventSem(thefile->pipeSem, thefile->timeout
>= 0 ? thefile->timeout / 1000 : SEM_INDEFINITE_WAIT);
- if (rcwait == 0)
+ if (rcwait == 0) {
rc = DosRead(thefile->filedes, buf, *nbytes, &bytesread);
+ }
+ else if (rcwait == ERROR_TIMEOUT) {
+ *nbytes = 0;
+ return APR_TIMEUP;
+ }
}
if (rc) {