aboutsummaryrefslogtreecommitdiffstats
path: root/common/iobuf.c
diff options
context:
space:
mode:
authorWerner Koch <[email protected]>2023-06-09 15:40:53 +0000
committerWerner Koch <[email protected]>2023-07-05 09:15:55 +0000
commit8425cdcc8eb98a1e894f629f46ce32b5c52ea01a (patch)
tree7096ac5c66a62485e9d65506a8900e4a26814be2 /common/iobuf.c
parentw32: Map ERROR_FILE_INVALID to EIO. (diff)
downloadgnupg-8425cdcc8eb98a1e894f629f46ce32b5c52ea01a.tar.gz
gnupg-8425cdcc8eb98a1e894f629f46ce32b5c52ea01a.zip
gpg: Print status line and proper diagnostics for write errors.
* common/iobuf.c (file_filter): Improve diagnostics. * g10/build-packet.c (do_plaintext): Make sure to cache all error cases. -- GnuPG-bug-id: 6528
Diffstat (limited to 'common/iobuf.c')
-rw-r--r--common/iobuf.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/common/iobuf.c b/common/iobuf.c
index f4766c6a4..4d207d3f8 100644
--- a/common/iobuf.c
+++ b/common/iobuf.c
@@ -483,7 +483,8 @@ file_filter (void *opaque, int control, iobuf_t chain, byte * buf,
if (ec != ERROR_BROKEN_PIPE)
{
rc = gpg_error_from_errno (ec);
- log_error ("%s: read error: ec=%d\n", a->fname, ec);
+ log_error ("%s: read error: %s (ec=%d)\n",
+ a->fname, gpg_strerror (rc), ec);
}
}
else if (!nread)
@@ -543,7 +544,8 @@ file_filter (void *opaque, int control, iobuf_t chain, byte * buf,
{
int ec = (int) GetLastError ();
rc = gpg_error_from_errno (ec);
- log_error ("%s: write error: ec=%d\n", a->fname, ec);
+ log_error ("%s: write error: %s (ec=%d)\n",
+ a->fname, gpg_strerror (rc), ec);
break;
}
p += n;
@@ -601,7 +603,8 @@ file_filter (void *opaque, int control, iobuf_t chain, byte * buf,
if (ec != ERROR_BROKEN_PIPE)
{
rc = gpg_error_from_errno (ec);
- log_error ("%s: read error: ec=%d\n", a->fname, ec);
+ log_error ("%s: read error: %s (ec=%d)\n",
+ a->fname, gpg_strerror (rc), ec);
}
a->npeeked = 0;
}