| 290 | } |
| 291 | |
| 292 | static const char *get_mutex_filename(apr_pool_t *p, mutex_cfg_t *mxcfg, |
| 293 | const char *type, |
| 294 | const char *instance_id) |
| 295 | { |
| 296 | const char *pid_suffix = ""; |
| 297 | |
| 298 | if (!mutex_needs_file(mxcfg->mech)) { |
| 299 | return NULL; |
| 300 | } |
| 301 | |
| 302 | #if HAVE_UNISTD_H |
| 303 | if (!mxcfg->omit_pid) { |
| 304 | pid_suffix = apr_psprintf(p, ".%" APR_PID_T_FMT, getpid()); |
| 305 | } |
| 306 | #endif |
| 307 | |
| 308 | return ap_server_root_relative(p, |
| 309 | apr_pstrcat(p, |
| 310 | mxcfg->dir, |
| 311 | "/", |
| 312 | type, |
| 313 | instance_id ? "-" : "", |
| 314 | instance_id ? instance_id : "", |
| 315 | pid_suffix, |
| 316 | NULL)); |
| 317 | } |
| 318 | |
| 319 | static mutex_cfg_t *mxcfg_lookup(apr_pool_t *p, const char *type) |
| 320 | { |
no test coverage detected