summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--agent/findkey.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/agent/findkey.c b/agent/findkey.c
index 8c128ce00..b0a941078 100644
--- a/agent/findkey.c
+++ b/agent/findkey.c
@@ -172,6 +172,8 @@ write_extended_private_key (char *fname, estream_t fp, int update, int newkey,
goto leave;
err = nvc_write (pk, fp);
+ if (!err)
+ err = es_fflush (fp);
if (err)
{
log_error ("error writing '%s': %s\n", fname, gpg_strerror (err));