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

Function dav_dbm_open

modules/dav/fs/dbm.c:183–210  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

181}
182
183static 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
212void dav_dbm_close(dav_db *db)
213{

Callers 1

dav_propdb_openFunction · 0.85

Calls 3

dav_fs_dir_file_nameFunction · 0.85
dav_fs_ensure_state_dirFunction · 0.85
dav_dbm_open_directFunction · 0.85

Tested by

no test coverage detected