httpd-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From r..@locus.apache.org
Subject cvs commit: apache-2.0/src/lib/apr/file_io/unix readwrite.c
Date Thu, 02 Mar 2000 18:48:37 GMT
rbb         00/03/02 10:48:37

  Modified:    src/lib/apr/file_io/unix readwrite.c
  Log:
  We should never set the number of bytes written to -1 and return an error.
  Errors are returned through the status, and we wrote zero bytes.
  
  Revision  Changes    Path
  1.24      +10 -8     apache-2.0/src/lib/apr/file_io/unix/readwrite.c
  
  Index: readwrite.c
  ===================================================================
  RCS file: /home/cvs/apache-2.0/src/lib/apr/file_io/unix/readwrite.c,v
  retrieving revision 1.23
  retrieving revision 1.24
  diff -u -r1.23 -r1.24
  --- readwrite.c	2000/03/02 12:51:08	1.23
  +++ readwrite.c	2000/03/02 18:48:36	1.24
  @@ -71,7 +71,7 @@
       ap_ssize_t rv;
   
       if (thefile->filedes < 0) {
  -        *nbytes = -1;
  +        *nbytes = 0;
           return APR_EBADF;
       }
       
  @@ -104,11 +104,11 @@
               } while (srv == -1 && errno == EINTR);
   
               if (srv == 0) {
  -                (*nbytes) = -1;
  +                (*nbytes) = 0;
                   return APR_TIMEUP;
               }
               else if (srv < 0) {
  -                (*nbytes) = -1;
  +                (*nbytes) = 0;
                   return errno;
               }
               else {
  @@ -126,10 +126,11 @@
           || (errno != EINTR && !thefile->buffered && thefile->pipe
== 0 ))) {
           thefile->eof_hit = 1;
       }
  -    *nbytes = rv;
       if (rv == -1) {
  +        (*nbytes) = 0;
           return errno;
       }
  +    *nbytes = rv;
       return APR_SUCCESS;
   }
   
  @@ -149,7 +150,7 @@
       ap_size_t rv;
   
       if (thefile->filedes < 0) {
  -        *nbytes = -1;
  +        *nbytes = 0;
           return APR_EBADF;
       }
   
  @@ -182,11 +183,11 @@
               } while (srv == -1 && errno == EINTR);
   
               if (srv == 0) {
  -                (*nbytes) = -1;
  +                (*nbytes) = 0;
                   return APR_TIMEUP;
               }
               else if (srv < 0) {
  -                (*nbytes) = -1;
  +                (*nbytes) = 0;
                   return errno;
               }
               else {
  @@ -197,10 +198,11 @@
           }  
       }   /* BUFFERED ?? */
   
  -    *nbytes = rv;
       if (rv == -1) {
  +        (*nbytes) = 0;
           return errno;
       }
  +    *nbytes = rv;
       return APR_SUCCESS;
   }
   
  
  
  

Mime
View raw message