diff options
author | Marcus Boerger <helly@php.net> | 2002-11-05 14:46:36 +0000 |
---|---|---|
committer | Marcus Boerger <helly@php.net> | 2002-11-05 14:46:36 +0000 |
commit | 177b24a44ee3b0ff39889a1ef1f896edf559a389 (patch) | |
tree | a72933d329f02221d61f564caa9c4423e7cb6a5f /ext/dba/dba_cdb.c | |
parent | 41a77bccba8f597d694f5b66b289f1bba6529a26 (diff) | |
download | php-git-177b24a44ee3b0ff39889a1ef1f896edf559a389.tar.gz |
Why did open fail?
Diffstat (limited to 'ext/dba/dba_cdb.c')
-rw-r--r-- | ext/dba/dba_cdb.c | 8 |
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; } |