| 181 | } |
| 182 | |
| 183 | static dav_error * dav_dbm_open(apr_pool_t * p, const dav_resource *resource, |
| 184 | int ro, dav_db **pdb) |
| 185 | { |
| 186 | const char *dirpath; |
| 187 | const char *fname; |
| 188 | const char *pathname; |
| 189 | |
| 190 | /* Get directory and filename for resource */ |
| 191 | /* ### should test this result value... */ |
| 192 | (void) dav_fs_dir_file_name(resource, &dirpath, &fname); |
| 193 | |
| 194 | /* If not opening read-only, ensure the state dir exists */ |
| 195 | if (!ro) { |
| 196 | /* ### what are the perf implications of always checking this? */ |
| 197 | dav_fs_ensure_state_dir(p, dirpath); |
| 198 | } |
| 199 | |
| 200 | pathname = apr_pstrcat(p, dirpath, "/" DAV_FS_STATE_DIR "/", |
| 201 | fname ? fname : DAV_FS_STATE_FILE_FOR_DIR, |
| 202 | NULL); |
| 203 | |
| 204 | /* ### readers cannot open while a writer has this open; we should |
| 205 | ### perform a few retries with random pauses. */ |
| 206 | |
| 207 | /* ### do we need to deal with the umask? */ |
| 208 | |
| 209 | return dav_dbm_open_direct(p, pathname, ro, pdb); |
| 210 | } |
| 211 | |
| 212 | void dav_dbm_close(dav_db *db) |
| 213 | { |
no test coverage detected