Author: bjh Date: Thu Feb 23 04:16:51 2006 New Revision: 380102 URL: http://svn.apache.org/viewcvs?rev=380102&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/0.9.x/file_io/os2/readwrite.c apr/apr/branches/0.9.x/file_io/os2/seek.c Modified: apr/apr/branches/0.9.x/file_io/os2/readwrite.c URL: http://svn.apache.org/viewcvs/apr/apr/branches/0.9.x/file_io/os2/readwrite.c?rev=380102&r1=380101&r2=380102&view=diff ============================================================================== --- apr/apr/branches/0.9.x/file_io/os2/readwrite.c (original) +++ apr/apr/branches/0.9.x/file_io/os2/readwrite.c Thu Feb 23 04:16:51 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/0.9.x/file_io/os2/seek.c URL: http://svn.apache.org/viewcvs/apr/apr/branches/0.9.x/file_io/os2/seek.c?rev=380102&r1=380101&r2=380102&view=diff ============================================================================== --- apr/apr/branches/0.9.x/file_io/os2/seek.c (original) +++ apr/apr/branches/0.9.x/file_io/os2/seek.c Thu Feb 23 04:16:51 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; }