summaryrefslogtreecommitdiff
path: root/ext/dba/dba_cdb.c
diff options
context:
space:
mode:
Diffstat (limited to 'ext/dba/dba_cdb.c')
-rw-r--r--ext/dba/dba_cdb.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/ext/dba/dba_cdb.c b/ext/dba/dba_cdb.c
index 6b025d5466..eac2576aec 100644
--- a/ext/dba/dba_cdb.c
+++ b/ext/dba/dba_cdb.c
@@ -74,11 +74,13 @@ DBA_OPEN_FUNC(cdb)
make = 0;
file = php_stream_open_wrapper(info->path, "rb", STREAM_MUST_SEEK|IGNORE_PATH|ENFORCE_SAFE_MODE, NULL);
if (!file) {
+ *error = "Unable to open file";
return FAILURE;
}
#else
file = VCWD_OPEN(info->path, O_RDONLY);
if (file < 0) {
+ *error = "Unable to open file";
return FAILURE;
}
#endif
@@ -89,24 +91,28 @@ DBA_OPEN_FUNC(cdb)
make = 1;
file = php_stream_open_wrapper(info->path, "wb", STREAM_MUST_SEEK|IGNORE_PATH|ENFORCE_SAFE_MODE, NULL);
if (!file) {
+ *error = "Unable to open file";
return FAILURE;
}
break;
case DBA_WRITER:
+ *error = "Update operations are not supported";
return FAILURE; /* not supported */
#endif
default:
- /* currently not supported: */
+ *error = "Currently not supported";
return FAILURE;
}
cdb = ecalloc(sizeof(dba_cdb), 1);
if (!cdb) {
+ pinfo->dbf = cdb;
#if DBA_CDB_BUILTIN
php_stream_close(file);
#else
close(file);
#endif
+ *error = "Out of memory";
return FAILURE;
}