1
0
mirror of https://github.com/MariaDB/server.git synced 2025-11-30 05:23:50 +03:00

DbEnv.err

DbEnv.set_errfile

toku_db_env_err now writes to the file from set_errfile
toku_db_env_err calls toku_db_env_err_vararg

Fixed DbException.set_env, and callers of it.
Modified test1 to not use exceptions, since the test tried to use return codes.

Closes #214
Addresses #197
Addresses #215

git-svn-id: file:///svn/tokudb@1303 c7de825b-a66e-492c-adef-691d508d4ae1
This commit is contained in:
Yoni Fogel
2007-12-21 05:57:33 +00:00
parent 22e2a91e84
commit 10c82d9f0c
5 changed files with 40 additions and 7 deletions

View File

@@ -1,5 +1,6 @@
#include <assert.h>
#include <db_cxx.h>
#include <stdarg.h>
DbEnv::DbEnv (u_int32_t flags)
: do_no_exceptions((flags&DB_CXX_NO_EXCEPTIONS)!=0)
@@ -67,6 +68,21 @@ int DbEnv::maybe_throw_error(int err) {
if (err==0) return 0;
if (do_no_exceptions) return err;
DbException e(err);
e.set_env(the_env);
e.set_env(this);
throw e;
}
extern "C" {
void toku_db_env_err_vararg(const DB_ENV * env, int error, const char *fmt, va_list ap);
};
void DbEnv::err(int error, const char *fmt, ...) {
va_list ap;
va_start(ap, fmt);
toku_db_env_err_vararg(the_env, error, fmt, ap);
va_end(ap);
}
void DbEnv::set_errfile(FILE *errfile) {
the_env->set_errfile(the_env, errfile);
}