diff options
author | Werner Koch <[email protected]> | 2016-06-16 16:41:42 +0000 |
---|---|---|
committer | Werner Koch <[email protected]> | 2016-06-16 16:41:42 +0000 |
commit | eae301bf9c24fd17599c005ed3415450d6dce7e3 (patch) | |
tree | a39146280c89fc90984de4ee01dc2ddb3018e709 | |
parent | Post release updates (diff) | |
parent | g10: Fix another race condition for trustdb access. (diff) | |
download | gnupg-eae301bf9c24fd17599c005ed3415450d6dce7e3.tar.gz gnupg-eae301bf9c24fd17599c005ed3415450d6dce7e3.zip |
Merge branch 'master' into STABLE-BRANCH-2-2
--
Diffstat (limited to '')
-rw-r--r-- | g10/tdbio.c | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/g10/tdbio.c b/g10/tdbio.c index a4147090c..e27788e84 100644 --- a/g10/tdbio.c +++ b/g10/tdbio.c @@ -119,6 +119,7 @@ static int in_transaction; static void open_db (void); +static void create_hashtable (TRUSTREC *vr, int type); @@ -582,8 +583,13 @@ create_version_record (void) rec.rectype = RECTYPE_VER; rec.recnum = 0; rc = tdbio_write_record (&rec); + if (!rc) tdbio_sync (); + + if (!rc) + create_hashtable (&rec, 0); + return rc; } @@ -957,8 +963,6 @@ get_trusthashrec(void) if (rc) log_fatal (_("%s: error reading version record: %s\n"), db_name, gpg_strerror (rc) ); - if (!vr.r.ver.trusthashtbl) - create_hashtable (&vr, 0); trusthashtbl = vr.r.ver.trusthashtbl; } |