MCPcopy Create free account
hub / github.com/apache/httpd / get_mutex_filename

Function get_mutex_filename

server/util_mutex.c:292–317  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

290}
291
292static 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
319static mutex_cfg_t *mxcfg_lookup(apr_pool_t *p, const char *type)
320{

Callers 2

ap_global_mutex_createFunction · 0.85
ap_proc_mutex_createFunction · 0.85

Calls 2

mutex_needs_fileFunction · 0.85
ap_server_root_relativeFunction · 0.85

Tested by

no test coverage detected