Return-Path: Delivered-To: apmail-apr-commits-archive@www.apache.org Received: (qmail 46008 invoked from network); 23 Feb 2006 12:14:55 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur.apache.org with SMTP; 23 Feb 2006 12:14:55 -0000 Received: (qmail 98078 invoked by uid 500); 23 Feb 2006 12:14:52 -0000 Delivered-To: apmail-apr-commits-archive@apr.apache.org Received: (qmail 98025 invoked by uid 500); 23 Feb 2006 12:14:51 -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 98014 invoked by uid 99); 23 Feb 2006 12:14:51 -0000 Received: from asf.osuosl.org (HELO asf.osuosl.org) (140.211.166.49) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 23 Feb 2006 04:14:51 -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; Thu, 23 Feb 2006 04:14:50 -0800 Received: (qmail 45842 invoked by uid 65534); 23 Feb 2006 12:14:27 -0000 Message-ID: <20060223121427.45840.qmail@minotaur.apache.org> Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r380101 - in /apr/apr/branches/1.2.x/file_io/os2: readwrite.c seek.c Date: Thu, 23 Feb 2006 12:14:26 -0000 To: commits@apr.apache.org From: bjh@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: bjh Date: Thu Feb 23 04:14:18 2006 New Revision: 380101 URL: http://svn.apache.org/viewcvs?rev=380101&view=rev Log: OS/2: Add proper error handling when internal calls to apr_file_flush() fail within apr_file_read(), apr_file_gets() and apr_file_seek(). Backport from trunk of r379754. Modified: apr/apr/branches/1.2.x/file_io/os2/readwrite.c apr/apr/branches/1.2.x/file_io/os2/seek.c Modified: apr/apr/branches/1.2.x/file_io/os2/readwrite.c URL: http://svn.apache.org/viewcvs/apr/apr/branches/1.2.x/file_io/os2/readwrite.c?rev=380101&r1=380100&r2=380101&view=diff ============================================================================== --- apr/apr/branches/1.2.x/file_io/os2/readwrite.c (original) +++ apr/apr/branches/1.2.x/file_io/os2/readwrite.c Thu Feb 23 04:14:18 2006 @@ -42,7 +42,13 @@ apr_thread_mutex_lock(thefile->mutex); if (thefile->direction == 1) { - apr_file_flush(thefile); + int 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; @@ -299,6 +305,10 @@ for (i = 0; i < len-1; i++) { readlen = 1; rv = apr_file_read(thefile, str+i, &readlen); + + if (rv != APR_SUCCESS) { + break; + } if (readlen != 1) { rv = APR_EOF; Modified: apr/apr/branches/1.2.x/file_io/os2/seek.c URL: http://svn.apache.org/viewcvs/apr/apr/branches/1.2.x/file_io/os2/seek.c?rev=380101&r1=380100&r2=380101&view=diff ============================================================================== --- apr/apr/branches/1.2.x/file_io/os2/seek.c (original) +++ apr/apr/branches/1.2.x/file_io/os2/seek.c Thu Feb 23 04:14:18 2006 @@ -27,7 +27,12 @@ ULONG rc; if (thefile->direction == 1) { - apr_file_flush(thefile); + apr_status_t rv = apr_file_flush(thefile); + + if (rv != APR_SUCCESS) { + return rv; + } + thefile->bufpos = thefile->direction = thefile->dataRead = 0; }