| 452 | } |
| 453 | |
| 454 | AP_DECLARE(apr_status_t) ap_proc_mutex_create(apr_proc_mutex_t **mutex, |
| 455 | const char **name, |
| 456 | const char *type, |
| 457 | const char *instance_id, |
| 458 | server_rec *s, apr_pool_t *p, |
| 459 | apr_int32_t options) |
| 460 | { |
| 461 | apr_status_t rv; |
| 462 | const char *fname; |
| 463 | mutex_cfg_t *mxcfg = mxcfg_lookup(p, type); |
| 464 | |
| 465 | if (options) { |
| 466 | log_bad_create_options(s, type); |
| 467 | return APR_EINVAL; |
| 468 | } |
| 469 | |
| 470 | if (!mxcfg) { |
| 471 | log_unknown_type(s, type); |
| 472 | return APR_EINVAL; |
| 473 | } |
| 474 | |
| 475 | if (mxcfg->none) { |
| 476 | *mutex = NULL; |
| 477 | return APR_SUCCESS; |
| 478 | } |
| 479 | |
| 480 | fname = get_mutex_filename(p, mxcfg, type, instance_id); |
| 481 | |
| 482 | rv = apr_proc_mutex_create(mutex, fname, mxcfg->mech, p); |
| 483 | if (rv != APR_SUCCESS) { |
| 484 | log_create_failure(rv, s, type, fname); |
| 485 | return rv; |
| 486 | } |
| 487 | |
| 488 | if (name) |
| 489 | *name = fname; |
| 490 | |
| 491 | #ifdef AP_NEED_SET_MUTEX_PERMS |
| 492 | rv = ap_unixd_set_proc_mutex_perms(*mutex); |
| 493 | if (rv != APR_SUCCESS) { |
| 494 | log_perms_failure(rv, s, type); |
| 495 | } |
| 496 | #endif |
| 497 | |
| 498 | return rv; |
| 499 | } |
| 500 | |
| 501 | AP_CORE_DECLARE(void) ap_dump_mutexes(apr_pool_t *p, server_rec *s, apr_file_t *out) |
| 502 | { |
no test coverage detected