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-06-09 15:40:53 +0000
commit695cb04af5218cd7b42c7eaaefc186472b99a995 (patch)
tree44ec324b037911f3c6c3e55e667a8065baa579ee /common/iobuf.c
parentspeedo,w32: Call gpgconf --kill all (diff)
downloadgnupg-695cb04af5218cd7b42c7eaaefc186472b99a995.tar.gz
gnupg-695cb04af5218cd7b42c7eaaefc186472b99a995.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 825b97704..dee3b46b1 100644
--- a/common/iobuf.c
+++ b/common/iobuf.c
@@ -503,7 +503,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)
@@ -573,7 +574,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;
@@ -632,7 +634,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;
}