Return-Path: Delivered-To: apmail-apr-commits-archive@www.apache.org Received: (qmail 56519 invoked from network); 13 Mar 2006 19:29:50 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur.apache.org with SMTP; 13 Mar 2006 19:29:50 -0000 Received: (qmail 51537 invoked by uid 500); 13 Mar 2006 19:29:50 -0000 Delivered-To: apmail-apr-commits-archive@apr.apache.org Received: (qmail 51498 invoked by uid 500); 13 Mar 2006 19:29:49 -0000 Mailing-List: contact commits-help@apr.apache.org; run by ezmlm Precedence: bulk List-Post: List-Help: List-Unsubscribe: Reply-To: dev@apr.apache.org List-Id: Delivered-To: mailing list commits@apr.apache.org Received: (qmail 51487 invoked by uid 99); 13 Mar 2006 19:29:49 -0000 Received: from asf.osuosl.org (HELO asf.osuosl.org) (140.211.166.49) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 13 Mar 2006 11:29:49 -0800 X-ASF-Spam-Status: No, hits=-9.4 required=10.0 tests=ALL_TRUSTED,NO_REAL_NAME X-Spam-Check-By: apache.org Received: from [209.237.227.194] (HELO minotaur.apache.org) (209.237.227.194) by apache.org (qpsmtpd/0.29) with SMTP; Mon, 13 Mar 2006 11:29:48 -0800 Received: (qmail 56086 invoked by uid 65534); 13 Mar 2006 19:29:28 -0000 Message-ID: <20060313192928.56085.qmail@minotaur.apache.org> Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r385628 - in /apr/apr/branches/1.2.x/file_io/win32: filestat.c open.c readwrite.c seek.c Date: Mon, 13 Mar 2006 19:29:27 -0000 To: commits@apr.apache.org From: wrowe@apache.org X-Mailer: svnmailer-1.0.7 X-Virus-Checked: Checked by ClamAV on apache.org X-Spam-Rating: minotaur.apache.org 1.6.2 0/1000/N Author: wrowe Date: Mon Mar 13 11:29:27 2006 New Revision: 385628 URL: http://svn.apache.org/viewcvs?rev=385628&view=rev Log: Similar to the patches for unix/netware/os - percolate the flush response code upwards to the caller, and note some mutex-unprotected flushes on win32 Backport 385626 Modified: apr/apr/branches/1.2.x/file_io/win32/filestat.c apr/apr/branches/1.2.x/file_io/win32/open.c apr/apr/branches/1.2.x/file_io/win32/readwrite.c apr/apr/branches/1.2.x/file_io/win32/seek.c Modified: apr/apr/branches/1.2.x/file_io/win32/filestat.c URL: http://svn.apache.org/viewcvs/apr/apr/branches/1.2.x/file_io/win32/filestat.c?rev=385628&r1=385627&r2=385628&view=diff ============================================================================== --- apr/apr/branches/1.2.x/file_io/win32/filestat.c (original) +++ apr/apr/branches/1.2.x/file_io/win32/filestat.c Mon Mar 13 11:29:27 2006 @@ -375,6 +375,7 @@ BY_HANDLE_FILE_INFORMATION FileInfo; if (thefile->buffered) { + /* XXX: flush here is not mutex protected */ apr_status_t rv = apr_file_flush(thefile); if (rv != APR_SUCCESS) return rv; Modified: apr/apr/branches/1.2.x/file_io/win32/open.c URL: http://svn.apache.org/viewcvs/apr/apr/branches/1.2.x/file_io/win32/open.c?rev=385628&r1=385627&r2=385628&view=diff ============================================================================== --- apr/apr/branches/1.2.x/file_io/win32/open.c (original) +++ apr/apr/branches/1.2.x/file_io/win32/open.c Mon Mar 13 11:29:27 2006 @@ -242,6 +242,7 @@ } if (file->buffered) { + /* XXX: flush here is not mutex protected */ flush_rv = apr_file_flush((apr_file_t *)thefile); } CloseHandle(file->filehand); Modified: apr/apr/branches/1.2.x/file_io/win32/readwrite.c URL: http://svn.apache.org/viewcvs/apr/apr/branches/1.2.x/file_io/win32/readwrite.c?rev=385628&r1=385627&r2=385628&view=diff ============================================================================== --- apr/apr/branches/1.2.x/file_io/win32/readwrite.c (original) +++ apr/apr/branches/1.2.x/file_io/win32/readwrite.c Mon Mar 13 11:29:27 2006 @@ -171,7 +171,11 @@ apr_thread_mutex_lock(thefile->mutex); if (thefile->direction == 1) { - apr_file_flush(thefile); + rv = apr_file_flush(thefile); + if (rv != APR_SUCCESS) { + apr_thread_mutex_unlock(thefile->mutex); + return rv; + } thefile->bufpos = 0; thefile->direction = 0; thefile->dataRead = 0; Modified: apr/apr/branches/1.2.x/file_io/win32/seek.c URL: http://svn.apache.org/viewcvs/apr/apr/branches/1.2.x/file_io/win32/seek.c?rev=385628&r1=385627&r2=385628&view=diff ============================================================================== --- apr/apr/branches/1.2.x/file_io/win32/seek.c (original) +++ apr/apr/branches/1.2.x/file_io/win32/seek.c Mon Mar 13 11:29:27 2006 @@ -22,10 +22,14 @@ static apr_status_t setptr(apr_file_t *thefile, apr_off_t pos ) { apr_size_t newbufpos; + apr_status_t rv; DWORD rc; if (thefile->direction == 1) { - apr_file_flush(thefile); + /* XXX: flush here is not mutex protected */ + rv = apr_file_flush(thefile); + if (rv != APR_SUCCESS) + return rv; thefile->bufpos = thefile->dataRead = 0; thefile->direction = 0; }