aboutsummaryrefslogtreecommitdiffstats
path: root/g10/plaintext.c
diff options
context:
space:
mode:
authorWerner Koch <[email protected]>2010-06-07 13:33:02 +0000
committerWerner Koch <[email protected]>2010-06-07 13:33:02 +0000
commitbbe388b5db35be6ffece8ebd42f11372af016763 (patch)
tree73e1fe9697b969be66bd89953125010e5721efe1 /g10/plaintext.c
parentPrint --version etc via estream (diff)
downloadgnupg-bbe388b5db35be6ffece8ebd42f11372af016763.tar.gz
gnupg-bbe388b5db35be6ffece8ebd42f11372af016763.zip
Add unfinished gpgtar.
Collected changes and ports of bug fixes from stable.
Diffstat (limited to 'g10/plaintext.c')
-rw-r--r--g10/plaintext.c10
1 files changed, 9 insertions, 1 deletions
diff --git a/g10/plaintext.c b/g10/plaintext.c
index 85f7165bd..1d4c8c793 100644
--- a/g10/plaintext.c
+++ b/g10/plaintext.c
@@ -448,7 +448,15 @@ handle_plaintext (PKT_plaintext * pt, md_filter_context_t * mfx,
/* Make sure that stdout gets flushed after the plaintext has been
handled. This is for extra security as we do a flush anyway
before checking the signature. */
- fflush (stdout);
+ if (fflush (stdout))
+ {
+ /* We need to check the return code to detect errors like disk
+ full for short plaintexts. See bug#1207. Checking return
+ values is a good idea in any case. */
+ if (!rc)
+ rc = gpg_error_from_syserror ();
+ log_error ("error flushing `%s': %s\n", "[stdout]", strerror (errno));
+ }
if (fp && fp != stdout && fp != opt.outfp)
fclose (fp);