From 641df615da4937b0073c420a0503c5810c237972 Mon Sep 17 00:00:00 2001 From: "Neal H. Walfield" Date: Thu, 29 Oct 2015 10:09:58 +0100 Subject: 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 --- g10/trustdb.c | 11 +++++++---- 1 file 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 (); -- cgit v1.2.3