The handle can only store one error, so if an error path has more than
one call to error/perrorf, then the earlier error will be lost and
overwritten by the later one.
Fix two (more) cases of this.
Rich.
Show replies by date
From: "Richard W.M. Jones" <rjones(a)redhat.com>
When chunked encoding fails, the following error is added to
the handle:
[filename]: error in chunked encoding
However all paths returning -1 from receive_file_data already set a
more specific error, which this error hides.
---
src/proto.c | 1 -
1 file changed, 1 deletion(-)
diff --git a/src/proto.c b/src/proto.c
index 6dc4c16..1117368 100644
--- a/src/proto.c
+++ b/src/proto.c
@@ -781,7 +781,6 @@ guestfs___recv_file (guestfs_h *g, const char *filename)
}
if (r == -1) {
- error (g, _("%s: error in chunked encoding"), filename);
close (fd);
return -1;
}
--
1.8.3.1
From: "Richard W.M. Jones" <rjones(a)redhat.com>
When receive_file_data calls guestfs___recv_from_daemon, and that
function returns -1, it adds the following error to the handle:
receive_file_data: parse error in reply callback
However this hides a more specific error message which was already
added by guestfs___recv_from_daemon.
---
src/proto.c | 4 +---
1 file changed, 1 insertion(+), 3 deletions(-)
diff --git a/src/proto.c b/src/proto.c
index 1117368..fbe7e3b 100644
--- a/src/proto.c
+++ b/src/proto.c
@@ -830,10 +830,8 @@ receive_file_data (guestfs_h *g, void **buf_r)
guestfs_chunk chunk;
r = guestfs___recv_from_daemon (g, &len, &buf);
- if (r == -1) {
- error (g, _("receive_file_data: parse error in reply callback"));
+ if (r == -1)
return -1;
- }
if (len == GUESTFS_LAUNCH_FLAG || len == GUESTFS_CANCEL_FLAG) {
error (g, _("receive_file_data: unexpected flag received when reading file
chunks"));
--
1.8.3.1