diff options
author | Ingo Schwarze <schwarze@openbsd.org> | 2013-07-02 12:58:54 +0000 |
---|---|---|
committer | Ingo Schwarze <schwarze@openbsd.org> | 2013-07-02 12:58:54 +0000 |
commit | 6510438a900bb9f0b5fda8ef8e673f69eccb5835 (patch) | |
tree | 58651931a12cf918e56e8a4255f3ec3c48aafbdb /mandocdb.c | |
parent | 7d70d0d341159f15000e6c9c7a25198002cae12d (diff) | |
download | mandoc-6510438a900bb9f0b5fda8ef8e673f69eccb5835.tar.gz |
Turning off synchronous mode logically belongs to opening the database,
so move the statement into the function dbopen().
Diffstat (limited to 'mandocdb.c')
-rw-r--r-- | mandocdb.c | 20 |
1 files changed, 11 insertions, 9 deletions
@@ -471,15 +471,6 @@ main(int argc, char *argv[]) if (0 == dbopen(0)) goto out; - /* - * Since we're opening up a new database, we can - * turn off synchronous mode for much better - * performance. - */ -#ifndef __APPLE__ - SQL_EXEC("PRAGMA synchronous = OFF"); -#endif - ofmerge(mc, mp, &str_info, warnings && !use_all); dbclose(0); @@ -1972,6 +1963,17 @@ prepare_statements: sql = "INSERT INTO keys " "(bits,key,docid) VALUES (?,?,?)"; sqlite3_prepare_v2(db, sql, -1, &stmts[STMT_INSERT_KEY], NULL); + +#ifndef __APPLE__ + /* + * When opening a new database, we can turn off + * synchronous mode for much better performance. + */ + + if (real) + SQL_EXEC("PRAGMA synchronous = OFF"); +#endif + return(1); } |