You are viewing a plain text version of this content. The canonical link for it is here.
Posted to cvs@httpd.apache.org by tr...@locus.apache.org on 2000/06/23 13:38:11 UTC
cvs commit: apache-2.0/src/lib/apr/file_io/os2 pipe.c
trawick 00/06/23 04:38:10
Modified: src/lib/apr/file_io/os2 pipe.c
Log:
This change to the current state of CVS is supposed to fix a problem
introduced when pipes were made blocking by default as well as makes it
work a little faster when pipes are blocking. It also fixes a glitch
where setting pipe timeout to an invalid negative value returned
APR_SUCCESS.
We leave the pipe blocking after ap_create(), but it is non-blocking
during the DosConnectNPipe() call.
The pipe is set non-blocking if ap_set_pipe_timeout() is called with
timeout >= 0. The pipe is set blocking if called with timeout -1.
Revision Changes Path
1.23 +6 -3 apache-2.0/src/lib/apr/file_io/os2/pipe.c
Index: pipe.c
===================================================================
RCS file: /home/cvs/apache-2.0/src/lib/apr/file_io/os2/pipe.c,v
retrieving revision 1.22
retrieving revision 1.23
diff -u -r1.22 -r1.23
--- pipe.c 2000/06/20 19:36:21 1.22
+++ pipe.c 2000/06/23 11:38:09 1.23
@@ -68,7 +68,7 @@
char pipename[50];
sprintf(pipename, "/pipe/%d.%d", getpid(), id++);
- rc = DosCreateNPipe(pipename, filedes, NP_ACCESS_INBOUND, 1, 4096, 4096, 0);
+ rc = DosCreateNPipe(pipename, filedes, NP_ACCESS_INBOUND, NP_NOWAIT|1, 4096, 4096, 0);
if (rc)
return APR_OS2_STATUS(rc);
@@ -101,6 +101,10 @@
rc = DosSetNPipeSem(filedes[0], (HSEM)(*in)->pipeSem, 1);
+ if (!rc) {
+ rc = DosSetNPHState(filedes[0], NP_WAIT)
+ }
+
if (rc) {
DosClose(filedes[0]);
DosClose(filedes[1]);
@@ -146,13 +150,12 @@
{
if (thepipe->pipe == 1) {
thepipe->timeout = timeout;
- if (thepipe->timeout == 0) {
+ if (thepipe->timeout >= 0) {
return APR_OS2_STATUS(DosSetNPHState (thepipe->filedes, NP_NOWAIT));
}
else if (thepipe->timeout == -1) {
return APR_OS2_STATUS(DosSetNPHState (thepipe->filedes, NP_WAIT));
}
- return APR_SUCCESS;
}
return APR_EINVAL;
}