| 108 | } |
| 109 | |
| 110 | static 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. |
no outgoing calls
no test coverage detected