MCPcopy Index your code
hub / github.com/apache/httpd / mkdir_structure

Function mkdir_structure

modules/cache/mod_cache_disk.c:110–130  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

108}
109
110static apr_status_t mkdir_structure(disk_cache_conf *conf, const char *file, apr_pool_t *pool)
111{
112 apr_status_t rv;
113 char *p;
114
115 for (p = (char*)file + conf->cache_root_len + 1;;) {
116 p = strchr(p, '/');
117 if (!p)
118 break;
119 *p = '\0';
120
121 rv = apr_dir_make(file,
122 APR_UREAD|APR_UWRITE|APR_UEXECUTE, pool);
123 if (rv != APR_SUCCESS && !APR_STATUS_IS_EEXIST(rv)) {
124 return rv;
125 }
126 *p = '/';
127 ++p;
128 }
129 return APR_SUCCESS;
130}
131
132/* htcacheclean may remove directories underneath us.
133 * So, we'll try renaming three times at a cost of 0.002 seconds.

Callers 2

safe_file_renameFunction · 0.85
write_headersFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected