You are viewing a plain text version of this content. The canonical link for it is here.
Posted to cvs@httpd.apache.org by tr...@apache.org on 2013/11/15 23:03:17 UTC

svn commit: r1542416 - in /httpd/httpd/trunk: modules/dav/fs/lock.c modules/debugging/mod_firehose.c modules/loggers/mod_log_forensic.c server/mpm/winnt/mpm_winnt.c support/firehose.c support/rotatelogs.c

Author: trawick
Date: Fri Nov 15 22:03:16 2013
New Revision: 1542416

URL: http://svn.apache.org/r1542416
Log:
more apr_file_write_full() simplification (like r1542413)

Modified:
    httpd/httpd/trunk/modules/dav/fs/lock.c
    httpd/httpd/trunk/modules/debugging/mod_firehose.c
    httpd/httpd/trunk/modules/loggers/mod_log_forensic.c
    httpd/httpd/trunk/server/mpm/winnt/mpm_winnt.c
    httpd/httpd/trunk/support/firehose.c
    httpd/httpd/trunk/support/rotatelogs.c

Modified: httpd/httpd/trunk/modules/dav/fs/lock.c
URL: http://svn.apache.org/viewvc/httpd/httpd/trunk/modules/dav/fs/lock.c?rev=1542416&r1=1542415&r2=1542416&view=diff
==============================================================================
--- httpd/httpd/trunk/modules/dav/fs/lock.c (original)
+++ httpd/httpd/trunk/modules/dav/fs/lock.c Fri Nov 15 22:03:16 2013
@@ -812,7 +812,6 @@ static dav_error * dav_fs_save_locknull_
     const char *pathname;
     apr_file_t *file = NULL;
     dav_error *err = NULL;
-    apr_size_t amt;
     apr_status_t rv;
 
     if (pbuf->buf == NULL)
@@ -844,9 +843,8 @@ static dav_error * dav_fs_save_locknull_
                                          pathname));
     }
 
-    amt = pbuf->cur_len;
-    if ((rv = apr_file_write_full(file, pbuf->buf, amt, &amt)) != APR_SUCCESS
-        || amt != pbuf->cur_len) {
+    if ((rv = apr_file_write_full(file, pbuf->buf, pbuf->cur_len, NULL)) 
+        != APR_SUCCESS) {
         err = dav_new_error(p, HTTP_INTERNAL_SERVER_ERROR, 0, rv,
                             apr_psprintf(p,
                                         "Error writing %" APR_SIZE_T_FMT

Modified: httpd/httpd/trunk/modules/debugging/mod_firehose.c
URL: http://svn.apache.org/viewvc/httpd/httpd/trunk/modules/debugging/mod_firehose.c?rev=1542416&r1=1542415&r2=1542416&view=diff
==============================================================================
--- httpd/httpd/trunk/modules/debugging/mod_firehose.c (original)
+++ httpd/httpd/trunk/modules/debugging/mod_firehose.c Fri Nov 15 22:03:16 2013
@@ -127,7 +127,6 @@ static apr_status_t pumpit_cleanup(void 
     apr_status_t rv;
     apr_size_t hdr_len;
     char header[HEADER_LEN + 1];
-    apr_size_t bytes;
 
     if (!ctx->count) {
         return APR_SUCCESS;
@@ -138,7 +137,7 @@ static apr_status_t pumpit_cleanup(void 
             ctx->uuid, ctx->count);
     ap_xlate_proto_to_ascii(header, hdr_len);
 
-    rv = apr_file_write_full(ctx->conn->file, header, hdr_len, &bytes);
+    rv = apr_file_write_full(ctx->conn->file, header, hdr_len, NULL);
     if (APR_SUCCESS != rv) {
         if (ctx->conn->suppress) {
             /* ignore the error */

Modified: httpd/httpd/trunk/modules/loggers/mod_log_forensic.c
URL: http://svn.apache.org/viewvc/httpd/httpd/trunk/modules/loggers/mod_log_forensic.c?rev=1542416&r1=1542415&r2=1542416&view=diff
==============================================================================
--- httpd/httpd/trunk/modules/loggers/mod_log_forensic.c (original)
+++ httpd/httpd/trunk/modules/loggers/mod_log_forensic.c Fri Nov 15 22:03:16 2013
@@ -185,7 +185,6 @@ static int log_before(request_rec *r)
                                      &log_forensic_module);
     const char *id;
     hlog h;
-    apr_size_t n;
     apr_status_t rv;
 
     if (!cfg->fd || r->prev) {
@@ -221,9 +220,8 @@ static int log_before(request_rec *r)
     ap_assert(h.pos < h.end);
     *h.pos++ = '\n';
 
-    n = h.count-1;
-    rv = apr_file_write_full(cfg->fd, h.log, n, &n);
-    ap_assert(rv == APR_SUCCESS && n == h.count-1);
+    rv = apr_file_write_full(cfg->fd, h.log, h.count-1, NULL);
+    ap_assert(rv == APR_SUCCESS);
 
     apr_table_setn(r->notes, "forensic-id", id);
 
@@ -237,7 +235,7 @@ static int log_after(request_rec *r)
     const char *id = ap_get_module_config(r->request_config,
                                           &log_forensic_module);
     char *s;
-    apr_size_t l, n;
+    apr_size_t n;
     apr_status_t rv;
 
     if (!cfg->fd || id == NULL) {
@@ -245,9 +243,9 @@ static int log_after(request_rec *r)
     }
 
     s = apr_pstrcat(r->pool, "-", id, "\n", NULL);
-    l = n = strlen(s);
-    rv = apr_file_write_full(cfg->fd, s, n, &n);
-    ap_assert(rv == APR_SUCCESS && n == l);
+    n = strlen(s);
+    rv = apr_file_write_full(cfg->fd, s, n, NULL);
+    ap_assert(rv == APR_SUCCESS);
 
     return OK;
 }

Modified: httpd/httpd/trunk/server/mpm/winnt/mpm_winnt.c
URL: http://svn.apache.org/viewvc/httpd/httpd/trunk/server/mpm/winnt/mpm_winnt.c?rev=1542416&r1=1542415&r2=1542416&view=diff
==============================================================================
--- httpd/httpd/trunk/server/mpm/winnt/mpm_winnt.c (original)
+++ httpd/httpd/trunk/server/mpm/winnt/mpm_winnt.c Fri Nov 15 22:03:16 2013
@@ -358,7 +358,6 @@ static int send_handles_to_child(apr_poo
     HANDLE hDup;
     HANDLE os_start;
     HANDLE hScore;
-    apr_size_t BytesWritten;
 
     if (!DuplicateHandle(hCurrentProcess, child_ready_event, hProcess, &hDup,
         EVENT_MODIFY_STATE | SYNCHRONIZE, FALSE, 0)) {
@@ -366,7 +365,7 @@ static int send_handles_to_child(apr_poo
                      "Parent: Unable to duplicate the ready event handle for the child");
         return -1;
     }
-    if ((rv = apr_file_write_full(child_in, &hDup, sizeof(hDup), &BytesWritten))
+    if ((rv = apr_file_write_full(child_in, &hDup, sizeof(hDup), NULL))
             != APR_SUCCESS) {
         ap_log_error(APLOG_MARK, APLOG_CRIT, rv, ap_server_conf, APLOGNO(00393)
                      "Parent: Unable to send the exit event handle to the child");
@@ -378,7 +377,7 @@ static int send_handles_to_child(apr_poo
                      "Parent: Unable to duplicate the exit event handle for the child");
         return -1;
     }
-    if ((rv = apr_file_write_full(child_in, &hDup, sizeof(hDup), &BytesWritten))
+    if ((rv = apr_file_write_full(child_in, &hDup, sizeof(hDup), NULL))
             != APR_SUCCESS) {
         ap_log_error(APLOG_MARK, APLOG_CRIT, rv, ap_server_conf, APLOGNO(00395)
                      "Parent: Unable to send the exit event handle to the child");
@@ -395,7 +394,7 @@ static int send_handles_to_child(apr_poo
                      "Parent: Unable to duplicate the start mutex to the child");
         return -1;
     }
-    if ((rv = apr_file_write_full(child_in, &hDup, sizeof(hDup), &BytesWritten))
+    if ((rv = apr_file_write_full(child_in, &hDup, sizeof(hDup), NULL))
             != APR_SUCCESS) {
         ap_log_error(APLOG_MARK, APLOG_CRIT, rv, ap_server_conf, APLOGNO(00398)
                      "Parent: Unable to send the start mutex to the child");
@@ -412,7 +411,7 @@ static int send_handles_to_child(apr_poo
                      "Parent: Unable to duplicate the scoreboard handle to the child");
         return -1;
     }
-    if ((rv = apr_file_write_full(child_in, &hDup, sizeof(hDup), &BytesWritten))
+    if ((rv = apr_file_write_full(child_in, &hDup, sizeof(hDup), NULL))
             != APR_SUCCESS) {
         ap_log_error(APLOG_MARK, APLOG_CRIT, rv, ap_server_conf, APLOGNO(00401)
                      "Parent: Unable to send the scoreboard handle to the child");

Modified: httpd/httpd/trunk/support/firehose.c
URL: http://svn.apache.org/viewvc/httpd/httpd/trunk/support/firehose.c?rev=1542416&r1=1542415&r2=1542416&view=diff
==============================================================================
--- httpd/httpd/trunk/support/firehose.c (original)
+++ httpd/httpd/trunk/support/firehose.c Fri Nov 15 22:03:16 2013
@@ -342,7 +342,7 @@ static apr_status_t process_body(file_re
         if (APR_SUCCESS == (status = apr_file_open(&handle, native, APR_WRITE
                 | APR_CREATE | APR_APPEND, APR_OS_DEFAULT, pool))) {
             if (APR_SUCCESS != (status = apr_file_write_full(handle, str, len,
-                    &len))) {
+                    NULL))) {
                 apr_file_printf(file->file_err,
                         "Could not write fragment body to file '%s': %pm\n",
                         native, &status);

Modified: httpd/httpd/trunk/support/rotatelogs.c
URL: http://svn.apache.org/viewvc/httpd/httpd/trunk/support/rotatelogs.c?rev=1542416&r1=1542415&r2=1542416&view=diff
==============================================================================
--- httpd/httpd/trunk/support/rotatelogs.c (original)
+++ httpd/httpd/trunk/support/rotatelogs.c Fri Nov 15 22:03:16 2013
@@ -762,7 +762,7 @@ int main (int argc, const char * const a
             status.nMessCount++;
         }
         if (config.echo) {
-            if (apr_file_write_full(f_stdout, buf, nRead, &nWrite)) {
+            if (apr_file_write_full(f_stdout, buf, nRead, NULL)) {
                 fprintf(stderr, "Unable to write to stdout\n");
                 exit(4);
             }