httpd-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From b..@locus.apache.org
Subject cvs commit: apache-2.0/src/lib/apr/file_io/os2 fileio.h open.c pipe.c
Date Sun, 06 Aug 2000 14:55:54 GMT
bjh         00/08/06 07:55:54

  Modified:    src/lib/apr/file_io/os2 fileio.h open.c pipe.c
  Log:
  OS/2: Avoid unnecessary calls to set pipe blocking state.
  
  Revision  Changes    Path
  1.22      +1 -0      apache-2.0/src/lib/apr/file_io/os2/fileio.h
  
  Index: fileio.h
  ===================================================================
  RCS file: /home/cvs/apache-2.0/src/lib/apr/file_io/os2/fileio.h,v
  retrieving revision 1.21
  retrieving revision 1.22
  diff -u -r1.21 -r1.22
  --- fileio.h	2000/08/06 06:07:02	1.21
  +++ fileio.h	2000/08/06 14:55:54	1.22
  @@ -78,6 +78,7 @@
       int timeout;
       int pipe;
       HEV pipeSem;
  +    enum { BLK_UNKNOWN, BLK_OFF, BLK_ON } blocking;
   
       /* Stuff for buffered mode */
       char *buffer;
  
  
  
  1.31      +1 -0      apache-2.0/src/lib/apr/file_io/os2/open.c
  
  Index: open.c
  ===================================================================
  RCS file: /home/cvs/apache-2.0/src/lib/apr/file_io/os2/open.c,v
  retrieving revision 1.30
  retrieving revision 1.31
  diff -u -r1.30 -r1.31
  --- open.c	2000/08/02 05:25:47	1.30
  +++ open.c	2000/08/06 14:55:54	1.31
  @@ -80,6 +80,7 @@
       dafile->eof_hit = FALSE;
       dafile->buffer = NULL;
       dafile->flags = flag;
  +    dafile->blocking = BLK_ON;
       
       if ((flag & APR_READ) && (flag & APR_WRITE)) {
           mflags |= OPEN_ACCESS_READWRITE;
  
  
  
  1.26      +11 -2     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.25
  retrieving revision 1.26
  diff -u -r1.25 -r1.26
  --- pipe.c	2000/08/02 05:25:47	1.25
  +++ pipe.c	2000/08/06 14:55:54	1.26
  @@ -120,6 +120,7 @@
       (*in)->flags = 0;
       (*in)->pipe = 1;
       (*in)->timeout = -1;
  +    (*in)->blocking = BLK_ON;
       apr_register_cleanup(cont, *in, apr_file_cleanup, apr_null_cleanup);
   
       (*out) = (apr_file_t *)apr_palloc(cont, sizeof(apr_file_t));
  @@ -131,6 +132,7 @@
       (*out)->flags = 0;
       (*out)->pipe = 1;
       (*out)->timeout = -1;
  +    (*out)->blocking = BLK_ON;
       apr_register_cleanup(cont, *out, apr_file_cleanup, apr_null_cleanup);
   
       return APR_SUCCESS;
  @@ -150,11 +152,18 @@
   {
       if (thepipe->pipe == 1) {
           thepipe->timeout = timeout;
  +
           if (thepipe->timeout >= 0) {
  -            return APR_OS2_STATUS(DosSetNPHState (thepipe->filedes, NP_NOWAIT));
  +            if (thepipe->blocking != BLK_OFF) {
  +                thepipe->blocking = BLK_OFF;
  +                return APR_OS2_STATUS(DosSetNPHState(thepipe->filedes, NP_NOWAIT));
  +            }
           }
           else if (thepipe->timeout == -1) {
  -            return APR_OS2_STATUS(DosSetNPHState (thepipe->filedes, NP_WAIT));
  +            if (thepipe->blocking != BLK_ON) {
  +                thepipe->blocking = BLK_ON;
  +                return APR_OS2_STATUS(DosSetNPHState(thepipe->filedes, NP_WAIT));
  +            }
           }
       }
       return APR_EINVAL;
  
  
  

Mime
View raw message