Skip to content

Commit

Permalink
fix: add error logging
Browse files Browse the repository at this point in the history
Signed-off-by: Felipe Zipitria <[email protected]>
  • Loading branch information
fzipi committed May 29, 2024
1 parent 1d83852 commit f051286
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions apache2/modsecurity.c
Original file line number Diff line number Diff line change
Expand Up @@ -131,6 +131,7 @@ int acquire_global_lock(apr_global_mutex_t *lock, apr_pool_t *mp) {
// get platform temp dir
rc = apr_temp_dir_get(&temp_dir, mp);
if (rc != APR_SUCCESS) {
ap_log_perror("ModSecurity: Could not get temp dir");
return -1;
}

Expand All @@ -139,13 +140,15 @@ int acquire_global_lock(apr_global_mutex_t *lock, apr_pool_t *mp) {

rc = apr_file_mktemp(&lock_name, path, 0, mp);
if (rc != APR_SUCCESS) {
ap_log_perror(APLOG_MARK, APLOG_ERR, 0, NULL, " ModSecurity: Could not create temporary file for global lock");
return -1;
}
// below func always return APR_SUCCESS
apr_file_name_get(&filename, lock_name);

rc = apr_global_mutex_create(&lock, filename, APR_LOCK_DEFAULT, mp);
if (rc != APR_SUCCESS) {
ap_log_perror(APLOG_MARK, APLOG_ERR, 0, NULL, " ModSecurity: Could not create global mutex");
return -1;
}
return APR_SUCCESS;
Expand Down

0 comments on commit f051286

Please sign in to comment.