diff options
author | Neal H. Walfield <neal@g10code.com> | 2015-10-29 10:09:58 +0100 |
---|---|---|
committer | Neal H. Walfield <neal@g10code.com> | 2015-10-29 10:10:42 +0100 |
commit | 641df615da4937b0073c420a0503c5810c237972 (patch) | |
tree | 38f99589adfac2474cfa67cef7f6285a8878afa4 /g10/trustdb.c | |
parent | gpg: Eliminate a memory leak. (diff) | |
download | gnupg2-641df615da4937b0073c420a0503c5810c237972.tar.xz gnupg2-641df615da4937b0073c420a0503c5810c237972.zip |
gpg: Display the correct error message.
* g10/trustdb.c (validate_keys): If tdbio_update_version_record fails,
RC does not contain the error code. Save the error code in rc2 and
use that.
--
Signed-off-by: Neal H. Walfield <neal@g10code.com>
Diffstat (limited to '')
-rw-r--r-- | g10/trustdb.c | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/g10/trustdb.c b/g10/trustdb.c index 54a779e08..64de98553 100644 --- a/g10/trustdb.c +++ b/g10/trustdb.c @@ -2106,6 +2106,8 @@ validate_keys (int interactive) release_key_hash_table (stored); if (!rc && !quit) /* mark trustDB as checked */ { + int rc2; + if (next_expire == 0xffffffff || next_expire < start_time ) tdbio_write_nextcheck (0); else @@ -2115,11 +2117,12 @@ validate_keys (int interactive) strtimestamp (next_expire)); } - if(tdbio_update_version_record()!=0) + rc2 = tdbio_update_version_record (); + if (rc2) { - log_error(_("unable to update trustdb version record: " - "write failed: %s\n"), gpg_strerror (rc)); - tdbio_invalid(); + log_error (_("unable to update trustdb version record: " + "write failed: %s\n"), gpg_strerror (rc2)); + tdbio_invalid (); } do_sync (); |