updated on Thu Jan 26 16:09:46 UTC 2012
[aur-mirror.git] / liferea-ext4 / getenv_sync.patch
blobdfa4b0aa9f17701520dc73a944600bff4f763772
1 diff -Nurp liferea-1.6.0.orig/src/db.c liferea-1.6.0/src/db.c
2 --- liferea-1.6.0.orig/src/db.c 2009-10-21 18:15:30.409704157 -0300
3 +++ liferea-1.6.0/src/db.c 2009-10-21 18:16:36.898701497 -0300
4 @@ -171,7 +171,18 @@ open:
5 g_free (filename);
7 sqlite3_extended_result_codes (db, TRUE);
8 -
10 + char *sync = getenv ("LIFEREA_SYNCHRONOUS");
11 + if (sync)
12 + {
13 + gchar *err;
14 + gchar *sql = sqlite3_mprintf ("pragma synchronous = %d;", atoi(sync));
15 + if (SQLITE_OK != sqlite3_exec(db, sql, NULL, NULL, &err))
16 + debug1 (DEBUG_DB, "setting pragma synchronous failed: %s", err);
17 + sqlite3_free (sql);
18 + sqlite3_free (err);
19 + }
21 /* create info table/check versioning info */
22 schemaVersion = db_get_schema_version ();
23 debug1 (DEBUG_DB, "current DB schema version: %d", schemaVersion);