* 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:
Paul Querna
2009-03-27 13:27:44 +00:00
parent 0897f72366
commit 78aa2421a7

View File

@ -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);