Return-Path: Delivered-To: apmail-apr-commits-archive@www.apache.org Received: (qmail 79090 invoked from network); 22 Feb 2006 11:26:55 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur.apache.org with SMTP; 22 Feb 2006 11:26:55 -0000 Received: (qmail 50416 invoked by uid 500); 22 Feb 2006 11:26:51 -0000 Delivered-To: apmail-apr-commits-archive@apr.apache.org Received: (qmail 50316 invoked by uid 500); 22 Feb 2006 11:26:50 -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 50304 invoked by uid 99); 22 Feb 2006 11:26:50 -0000 Received: from asf.osuosl.org (HELO asf.osuosl.org) (140.211.166.49) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 22 Feb 2006 03:26:50 -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; Wed, 22 Feb 2006 03:26:49 -0800 Received: (qmail 78866 invoked by uid 65534); 22 Feb 2006 11:26:22 -0000 Message-ID: <20060222112622.78865.qmail@minotaur.apache.org> Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r379754 - in /apr/apr/trunk/file_io/os2: readwrite.c seek.c Date: Wed, 22 Feb 2006 11:26:21 -0000 To: commits@apr.apache.org From: bjh@apache.org X-Mailer: svnmailer-1.0.6 X-Virus-Checked: Checked by ClamAV on apache.org X-Spam-Rating: minotaur.apache.org 1.6.2 0/1000/N Author: bjh Date: Wed Feb 22 03:26:16 2006 New Revision: 379754 URL: http://svn.apache.org/viewcvs?rev=379754&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(). Modified: apr/apr/trunk/file_io/os2/readwrite.c apr/apr/trunk/file_io/os2/seek.c Modified: apr/apr/trunk/file_io/os2/readwrite.c URL: http://svn.apache.org/viewcvs/apr/apr/trunk/file_io/os2/readwrite.c?rev=379754&r1=379753&r2=379754&view=diff ============================================================================== --- apr/apr/trunk/file_io/os2/readwrite.c (original) +++ apr/apr/trunk/file_io/os2/readwrite.c Wed Feb 22 03:26:16 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/trunk/file_io/os2/seek.c URL: http://svn.apache.org/viewcvs/apr/apr/trunk/file_io/os2/seek.c?rev=379754&r1=379753&r2=379754&view=diff ============================================================================== --- apr/apr/trunk/file_io/os2/seek.c (original) +++ apr/apr/trunk/file_io/os2/seek.c Wed Feb 22 03:26:16 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; }