chiark / gitweb /
Import gnupg2_2.1.18-8~deb9u1.debian.tar.bz2
[gnupg2.git] / patches / 0050-gpg-Flush-stdout-before-printing-stats-with-check-si.patch
1 From: Werner Koch <wk@gnupg.org>
2 Date: Mon, 13 Mar 2017 17:42:08 +0100
3 Subject: gpg: Flush stdout before printing stats with --check-sigs.
4
5 * g10/keylist.c (print_signature_stats): Flush stdout.
6 (list_keyblock_colon): Use es_flush instead of fflush.
7
8 Signed-off-by: Werner Koch <wk@gnupg.org>
9 (cherry picked from commit 9a77b3b6e41f97b1209ad61c04b3dd33242ecae8)
10 ---
11  g10/keylist.c | 6 +++++-
12  1 file changed, 5 insertions(+), 1 deletion(-)
13
14 diff --git a/g10/keylist.c b/g10/keylist.c
15 index abdcb9f..4078053 100644
16 --- a/g10/keylist.c
17 +++ b/g10/keylist.c
18 @@ -465,6 +465,10 @@ print_signature_stats (struct keylist_context *s)
19    if (!s->check_sigs)
20      return;  /* Signature checking was not requested.  */
21  
22 +  /* Better flush stdout so that the stats are always printed after
23 +   * the output.  */
24 +  es_fflush (es_stdout);
25 +
26    if (s->good_sigs)
27      log_info (ngettext("%d good signature\n",
28                         "%d good signatures\n", s->good_sigs), s->good_sigs);
29 @@ -1447,7 +1451,7 @@ list_keyblock_colon (ctrl_t ctrl, kbnode_t keyblock,
30             {
31               PKT_public_key *signer_pk = NULL;
32  
33 -             fflush (stdout);
34 +             es_fflush (es_stdout);
35               if (opt.no_sig_cache)
36                 signer_pk = xmalloc_clear (sizeof (PKT_public_key));
37