]> granicus.if.org Git - apache/commitdiff
apr_file_write_full() simplification (like r1542413 and r1542416)
authorJeff Trawick <trawick@apache.org>
Sat, 16 Nov 2013 12:13:39 +0000 (12:13 +0000)
committerJeff Trawick <trawick@apache.org>
Sat, 16 Nov 2013 12:13:39 +0000 (12:13 +0000)
hopefully I sidestepped the surprising conflation of OK/APR_SUCCESS
in this code

git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1542493 13f79535-47bb-0310-9956-ffa450edef68

modules/lua/lua_request.c

index 74f264315ab5078c37305b3b42f5091fb4002068..18714d718fc2ae2790dd711dd732ec03c50ccefa 100644 (file)
@@ -229,7 +229,6 @@ static apr_status_t lua_write_body(request_rec *r, apr_file_t *file, apr_off_t *
                   len_read,
                   rpos = 0;
         apr_off_t length = r->remaining;
-        apr_size_t written;
 
         *size = length;
         while ((len_read =
@@ -241,9 +240,9 @@ static apr_status_t lua_write_body(request_rec *r, apr_file_t *file, apr_off_t *
                 rsize = len_read;
 
             rc = apr_file_write_full(file, argsbuffer, (apr_size_t) rsize,
-                                     &written);
-            if (written != rsize || rc != OK)
-                return APR_ENOSPC;
+                                     NULL);
+            if (rc != APR_SUCCESS)
+                return rc;
             rpos += rsize;
         }
     }