]> git.ipfire.org Git - thirdparty/apache/httpd.git/commitdiff
* server/log.c (ap_log_pid): Use more traditional C style in httpd for
authorJoe Orton <jorton@apache.org>
Mon, 16 Mar 2020 12:19:59 +0000 (12:19 +0000)
committerJoe Orton <jorton@apache.org>
Mon, 16 Mar 2020 12:19:59 +0000 (12:19 +0000)
  exception-handling.  No functional change.

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

server/log.c

index 07fb358a2af5f118d6b9448e77b54465a8170c6a..cc32f58bc5aebcdbd88a386444b58a8b06e99e21 100644 (file)
@@ -1570,14 +1570,10 @@ AP_DECLARE(void) ap_log_pid(apr_pool_t *p, const char *filename)
     apr_snprintf(pidstr, sizeof pidstr, "%" APR_PID_T_FMT APR_EOL_STR, mypid);
 
     perms = APR_UREAD | APR_UWRITE | APR_GREAD | APR_WREAD;
-    rv = apr_file_perms_set(temp_fname, perms);    
-    if (rv == APR_SUCCESS)
-        rv = apr_file_write_full(pid_file, pidstr, strlen(pidstr), NULL);
-    if (rv == APR_SUCCESS)
-        rv = apr_file_close(pid_file);
-    if (rv == APR_SUCCESS)
-        rv = apr_file_rename(temp_fname, fname, p);
-    if (rv != APR_SUCCESS) {
+    if ((rv = apr_file_perms_set(temp_fname, perms)) != APR_SUCCESS
+        || (rv = apr_file_write_full(pid_file, pidstr, strlen(pidstr), NULL)) != APR_SUCCESS
+        || (rv = apr_file_close(pid_file)) != APR_SUCCESS
+        || (rv = apr_file_rename(temp_fname, fname, p)) != APR_SUCCESS) {
         ap_log_error(APLOG_MARK, APLOG_ERR, rv, NULL, APLOGNO(10231)
                      "%s: Failed creating pid file %s",
                      ap_server_argv0, temp_fname);