| 85 | } |
| 86 | |
| 87 | static 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 ?? */ |
no test coverage detected