From 845110441e394ff8f2d75782b85d1f6887ccc635 Mon Sep 17 00:00:00 2001 From: Joe Orton Date: Mon, 16 Mar 2020 12:19:59 +0000 Subject: * server/log.c (ap_log_pid): Use more traditional C style in httpd for 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 | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) (limited to 'server/log.c') diff --git a/server/log.c b/server/log.c index 07fb358a2a..cc32f58bc5 100644 --- a/server/log.c +++ b/server/log.c @@ -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); -- cgit v1.2.3