about summary refs log tree commit diff
diff options
context:
space:
mode:
-rw-r--r--src/libstore/local-store.cc4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/libstore/local-store.cc b/src/libstore/local-store.cc
index 7db2aabe4875..8e5448446065 100644
--- a/src/libstore/local-store.cc
+++ b/src/libstore/local-store.cc
@@ -219,6 +219,10 @@ LocalStore::LocalStore()
     /* !!! check whether sqlite has been built with foreign key
        support */
     
+    /* "Normal" synchronous mode should be safe enough. */
+    if (sqlite3_exec(db, "pragma synchronous = normal;", 0, 0, 0) != SQLITE_OK)
+        throw SQLiteError(db, "changing synchronous mode to normal");
+
     /* Check the current database schema and if necessary do an
        upgrade.  !!! Race condition: several processes could start
        the upgrade at the same time. */