1
0
mirror of git://git.gnupg.org/gnupg.git synced 2024-12-22 10:19:57 +01:00

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>
This commit is contained in:
Neal H. Walfield 2015-10-29 10:09:58 +01:00
parent d68bdc553a
commit 641df615da

View File

@ -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 ();