forked from lix-project/lix
* Disable calls to fsync() since Berkeley DB's DB_TXN_WRITE_NOSYNC
flag doesn't seem to work as advertised.
This commit is contained in:
parent
112ee89501
commit
15c60ca1b6
|
@ -146,6 +146,12 @@ void openEnv(DbEnv * env, const string & path, u_int32_t flags)
|
|||
}
|
||||
|
||||
|
||||
static int my_fsync(int fd)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
void Database::open(const string & path)
|
||||
{
|
||||
if (env) throw Error(format("environment already open"));
|
||||
|
@ -164,6 +170,8 @@ void Database::open(const string & path)
|
|||
env->set_lk_detect(DB_LOCK_DEFAULT);
|
||||
env->set_flags(DB_TXN_WRITE_NOSYNC | DB_LOG_AUTOREMOVE, 1);
|
||||
|
||||
db_env_set_func_fsync(my_fsync);
|
||||
|
||||
|
||||
/* The following code provides automatic recovery of the
|
||||
database environment. Recovery is necessary when a process
|
||||
|
|
Loading…
Reference in a new issue