gpg: Don't die immediately if the TOFU DB is locked.
authorNeal H. Walfield <neal@g10code.com>
Tue, 20 Oct 2015 13:12:23 +0000 (15:12 +0200)
committerNeal H. Walfield <neal@g10code.com>
Tue, 20 Oct 2015 13:12:23 +0000 (15:12 +0200)
* g10/tofu.c (opendb): Don't die immediately if the DB is locked.

--
Signed-off-by: Neal H. Walfield <neal@g10code.com>
g10/tofu.c

index 3f2cd25..4ad44eb 100644 (file)
@@ -487,6 +487,10 @@ opendb (char *filename, enum db_type type)
       db = NULL;
     }
 
+  /* If a DB is locked wait up to 5 seconds for the lock to be cleared
+     before failing.  */
+  sqlite3_busy_timeout (db, 5 * 1000);
+
   if (filename_free)
     xfree (filename);