apr-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From b..@apache.org
Subject svn commit: r379754 - in /apr/apr/trunk/file_io/os2: readwrite.c seek.c
Date Wed, 22 Feb 2006 11:26:21 GMT
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;
     }
 



Mime
View raw message