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

agent: Fix printed error in findkey.

* agent/findkey.c (agent_write_private_key): Fix error reporting.
This commit is contained in:
Werner Koch 2023-05-26 14:19:27 +02:00
parent fe881167c5
commit 7cf8c5c291
No known key found for this signature in database
GPG Key ID: E3FDFF218E45B72B

View File

@ -237,13 +237,14 @@ agent_write_private_key (const unsigned char *grip,
fp = fname ? es_fopen (fname, "wbx,mode=-rw") : NULL;
if (!fp)
{
err = gpg_error_from_syserror ();
log_error ("can't create '%s': %s\n", fname, gpg_strerror (err));
goto leave;
}
err = nvc_write (pk, fp);
if (!err)
err = es_fflush (fp);
if (!err && es_fflush (fp))
err = gpg_error_from_syserror ();
if (err)
{
log_error ("error writing '%s': %s\n", fname, gpg_strerror (err));