| 405 | #endif |
| 406 | |
| 407 | AP_DECLARE(apr_status_t) ap_global_mutex_create(apr_global_mutex_t **mutex, |
| 408 | const char **name, |
| 409 | const char *type, |
| 410 | const char *instance_id, |
| 411 | server_rec *s, apr_pool_t *p, |
| 412 | apr_int32_t options) |
| 413 | { |
| 414 | apr_status_t rv; |
| 415 | const char *fname; |
| 416 | mutex_cfg_t *mxcfg = mxcfg_lookup(p, type); |
| 417 | |
| 418 | if (options) { |
| 419 | log_bad_create_options(s, type); |
| 420 | return APR_EINVAL; |
| 421 | } |
| 422 | |
| 423 | if (!mxcfg) { |
| 424 | log_unknown_type(s, type); |
| 425 | return APR_EINVAL; |
| 426 | } |
| 427 | |
| 428 | if (mxcfg->none) { |
| 429 | *mutex = NULL; |
| 430 | return APR_SUCCESS; |
| 431 | } |
| 432 | |
| 433 | fname = get_mutex_filename(p, mxcfg, type, instance_id); |
| 434 | |
| 435 | rv = apr_global_mutex_create(mutex, fname, mxcfg->mech, p); |
| 436 | if (rv != APR_SUCCESS) { |
| 437 | log_create_failure(rv, s, type, fname); |
| 438 | return rv; |
| 439 | } |
| 440 | |
| 441 | if (name) |
| 442 | *name = fname; |
| 443 | |
| 444 | #ifdef AP_NEED_SET_MUTEX_PERMS |
| 445 | rv = ap_unixd_set_global_mutex_perms(*mutex); |
| 446 | if (rv != APR_SUCCESS) { |
| 447 | log_perms_failure(rv, s, type); |
| 448 | } |
| 449 | #endif |
| 450 | |
| 451 | return rv; |
| 452 | } |
| 453 | |
| 454 | AP_DECLARE(apr_status_t) ap_proc_mutex_create(apr_proc_mutex_t **mutex, |
| 455 | const char **name, |
no test coverage detected