Return-Path: Delivered-To: apmail-apache-cvs-archive@apache.org Received: (qmail 30890 invoked by uid 500); 27 May 2000 17:52:02 -0000 Mailing-List: contact apache-cvs-help@apache.org; run by ezmlm Precedence: bulk X-No-Archive: yes Reply-To: new-httpd@apache.org list-help: list-unsubscribe: list-post: Delivered-To: mailing list apache-cvs@apache.org Received: (qmail 30879 invoked by uid 500); 27 May 2000 17:52:02 -0000 Delivered-To: apmail-apache-2.0-cvs@apache.org Date: 27 May 2000 17:52:01 -0000 Message-ID: <20000527175201.30875.qmail@locus.apache.org> From: bjh@locus.apache.org To: apache-2.0-cvs@apache.org Subject: cvs commit: apache-2.0/src/lib/apr/file_io/os2 readwrite.c bjh 00/05/27 10:52:01 Modified: src/lib/apr/file_io/os2 readwrite.c Log: OS/2: Fix ap_write() to use the handle's mutex lock instead of critical sections & report write errors correctly in buffered mode. Revision Changes Path 1.26 +3 -3 apache-2.0/src/lib/apr/file_io/os2/readwrite.c Index: readwrite.c =================================================================== RCS file: /home/cvs/apache-2.0/src/lib/apr/file_io/os2/readwrite.c,v retrieving revision 1.25 retrieving revision 1.26 diff -u -r1.25 -r1.26 --- readwrite.c 2000/05/26 16:23:07 1.25 +++ readwrite.c 2000/05/27 17:52:01 1.26 @@ -153,7 +153,7 @@ int blocksize; int size = *nbytes; - DosEnterCritSec(); + ap_lock(thefile->mutex); if ( thefile->direction == 0 ) { // Position file pointer for writing at the offset we are logically reading from @@ -166,7 +166,7 @@ while (rc == 0 && size > 0) { if (thefile->bufpos == APR_FILE_BUFSIZE) // write buffer is full - ap_flush(thefile); + rc = ap_flush(thefile); blocksize = size > APR_FILE_BUFSIZE - thefile->bufpos ? APR_FILE_BUFSIZE - thefile->bufpos : size; memcpy(thefile->buffer + thefile->bufpos, pos, blocksize); @@ -175,7 +175,7 @@ size -= blocksize; } - DosExitCritSec(); + ap_unlock(thefile->mutex); return APR_OS2_STATUS(rc); } else { rc = DosWrite(thefile->filedes, buf, *nbytes, &byteswritten);