From 26d457c218c2e93b2e2cf316f0c1074c70894d0f Mon Sep 17 00:00:00 2001 From: "Neal H. Walfield" Date: Tue, 20 Oct 2015 15:12:23 +0200 Subject: [PATCH] gpg: Don't die immediately if the TOFU DB is locked. * g10/tofu.c (opendb): Don't die immediately if the DB is locked. -- Signed-off-by: Neal H. Walfield --- g10/tofu.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/g10/tofu.c b/g10/tofu.c index 3f2cd2512..4ad44eb81 100644 --- a/g10/tofu.c +++ b/g10/tofu.c @@ -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);