aboutsummaryrefslogtreecommitdiff
path: root/src/libstore/db.cc
diff options
context:
space:
mode:
authorEelco Dolstra <e.dolstra@tudelft.nl>2004-06-21 07:36:01 +0000
committerEelco Dolstra <e.dolstra@tudelft.nl>2004-06-21 07:36:01 +0000
commit15c60ca1b64a4e5dc874f60c764f0ccc8899d740 (patch)
tree551f4ac266a9727a4e3855a5db50c6b48b9dce8a /src/libstore/db.cc
parent112ee89501a936ad9c492780be6b63f53b2eb9ca (diff)
* Disable calls to fsync() since Berkeley DB's DB_TXN_WRITE_NOSYNC
flag doesn't seem to work as advertised.
Diffstat (limited to 'src/libstore/db.cc')
-rw-r--r--src/libstore/db.cc8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/libstore/db.cc b/src/libstore/db.cc
index 8c0678d0e..e792a371b 100644
--- a/src/libstore/db.cc
+++ b/src/libstore/db.cc
@@ -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