ViewVC Help
View File | Revision Log | Show Annotations | Download File
/cvs/deliantra/Deliantra-Client/DC/DB.pm
(Generate patch)

Comparing deliantra/Deliantra-Client/DC/DB.pm (file contents):
Revision 1.35 by root, Sun Mar 30 06:05:52 2008 UTC vs.
Revision 1.36 by root, Thu Apr 17 03:46:39 2008 UTC

51our $TILE_SEQ; 51our $TILE_SEQ;
52 52
53sub try_open_db { 53sub try_open_db {
54 File::Path::mkpath [$DB_HOME]; 54 File::Path::mkpath [$DB_HOME];
55 55
56 $DB_ENV = db_env_create; 56 my $env = db_env_create;
57 57
58 $DB_ENV->set_errfile (\*STDERR); 58 $env->set_errfile (\*STDERR);
59 $DB_ENV->set_msgfile (\*STDERR); 59 $env->set_msgfile (\*STDERR);
60 $DB_ENV->set_verbose (-1, 1); 60 $env->set_verbose (-1, 1);
61 61
62 $DB_ENV->set_flags (BDB::AUTO_COMMIT | BDB::LOG_AUTOREMOVE | BDB::TXN_WRITE_NOSYNC); 62 $env->set_flags (BDB::AUTO_COMMIT | BDB::LOG_AUTOREMOVE | BDB::TXN_WRITE_NOSYNC);
63 $DB_ENV->set_cachesize (0, 2048 * 1024, 0); 63 $env->set_cachesize (0, 2048 * 1024, 0);
64 64
65 db_env_open $DB_ENV, $DB_HOME, 65 db_env_open $env, $DB_HOME,
66 BDB::CREATE | BDB::REGISTER | BDB::RECOVER | BDB::INIT_MPOOL | BDB::INIT_LOCK | BDB::INIT_TXN, 66 BDB::CREATE | BDB::REGISTER | BDB::RECOVER | BDB::INIT_MPOOL | BDB::INIT_LOCK | BDB::INIT_TXN,
67 0666; 67 0666;
68 68
69 $! and die "cannot open database environment $DB_HOME: " . BDB::strerror; 69 $! and die "cannot open database environment $DB_HOME: " . BDB::strerror;
70
71 $DB_ENV = $env;
70 72
71 1 73 1
72} 74}
73 75
74sub table($) { 76sub table($) {

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines