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

Function dav_fs_dbm_error

modules/dav/fs/dbm.c:87–115  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

85}
86
87static dav_error * dav_fs_dbm_error(dav_db *db, apr_pool_t *p,
88 apr_status_t status)
89{
90 int errcode;
91 const char *errstr;
92 dav_error *err;
93 char errbuf[200];
94
95 if (status == APR_SUCCESS)
96 return NULL;
97
98 p = db ? db->pool : p;
99
100 /* There might not be a <db> if we had problems creating it. */
101 if (db == NULL) {
102 errcode = 1;
103 errstr = "Could not open database.";
104 if (APR_STATUS_IS_EDSOOPEN(status))
105 ap_log_error(APLOG_MARK, APLOG_CRIT, status, ap_server_conf, APLOGNO(00576)
106 "The DBM driver could not be loaded");
107 }
108 else {
109 (void) apr_dbm_geterror(db->file, &errcode, errbuf, sizeof(errbuf));
110 errstr = apr_pstrdup(p, errbuf);
111 }
112
113 err = dav_new_error(p, HTTP_INTERNAL_SERVER_ERROR, errcode, status, errstr);
114 return err;
115}
116
117/* ensure that our state subdirectory is present */
118/* ### does this belong here or in dav_fs_repos.c ?? */

Callers 6

dav_dbm_open_directFunction · 0.85
dav_dbm_fetchFunction · 0.85
dav_dbm_storeFunction · 0.85
dav_dbm_deleteFunction · 0.85
dav_dbm_firstkeyFunction · 0.85
dav_dbm_nextkeyFunction · 0.85

Calls 2

dav_new_errorFunction · 0.85
ap_log_errorFunction · 0.50

Tested by

no test coverage detected