mirror of
https://github.com/apache/httpd.git
synced 2025-08-20 16:09:55 +00:00
* modules/cluster/mod_heartmonitor.c
(hm_update_stats): Flush heartbeat file before closing, to make sure the file is always written correctly, and check for errors on flush or close. git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@759131 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
@ -183,8 +183,20 @@ static apr_status_t hm_update_stats(hm_ctx_t *ctx, apr_pool_t *p)
|
||||
}
|
||||
}
|
||||
|
||||
apr_file_close(fp);
|
||||
rv = apr_file_flush(fp);
|
||||
if (rv) {
|
||||
ap_log_error(APLOG_MARK, APLOG_CRIT, rv, NULL,
|
||||
"Heartmonitor: Unable to flush file: %s", path);
|
||||
return rv;
|
||||
}
|
||||
|
||||
rv = apr_file_close(fp);
|
||||
if (rv) {
|
||||
ap_log_error(APLOG_MARK, APLOG_CRIT, rv, NULL,
|
||||
"Heartmonitor: Unable to close file: %s", path);
|
||||
return rv;
|
||||
}
|
||||
|
||||
rv = apr_file_perms_set(path,
|
||||
APR_FPROT_UREAD | APR_FPROT_GREAD |
|
||||
APR_FPROT_WREAD);
|
||||
|
Reference in New Issue
Block a user