[Pkg-libvirt-commits] [libguestfs] 24/31: proto: Don't set g->last_errnum directly.
Hilko Bengen
bengen at moszumanska.debian.org
Sun Nov 1 17:13:10 UTC 2015
This is an automated email from the git hooks/post-receive script.
bengen pushed a commit to annotated tag upstream/1.29.46
in repository libguestfs.
commit 4ce94cede6a70379c787eb5c149b5d88c4a11045
Author: Richard W.M. Jones <rjones at redhat.com>
Date: Thu Jun 4 18:02:33 2015 +0100
proto: Don't set g->last_errnum directly.
I'm trying to think if there was any reason why we would have set
g->last_errnum directly instead of using the proper function
(guestfs_int_error_errno), but I cannot think of one.
Since error (g, ...) is just a macro that calls
guestfs_int_error_errno (g, 0, ...), this code is equivalent.
---
src/proto.c | 9 +++------
1 file changed, 3 insertions(+), 6 deletions(-)
diff --git a/src/proto.c b/src/proto.c
index a46a382..4ddd164 100644
--- a/src/proto.c
+++ b/src/proto.c
@@ -360,8 +360,7 @@ guestfs_int_send_file (guestfs_h *g, const char *filename)
}
if (g->user_cancel) {
- error (g, _("operation cancelled by user"));
- g->last_errnum = EINTR;
+ guestfs_int_error_errno (g, EINTR, _("operation cancelled by user"));
send_file_cancellation (g);
close (fd);
return -1;
@@ -857,10 +856,8 @@ receive_file_data (guestfs_h *g, void **buf_r)
xdr_destroy (&xdr);
if (chunk.cancel) {
- if (g->user_cancel) {
- error (g, _("operation cancelled by user"));
- g->last_errnum = EINTR;
- }
+ if (g->user_cancel)
+ guestfs_int_error_errno (g, EINTR, _("operation cancelled by user"));
else
error (g, _("file receive cancelled by daemon"));
free (chunk.data.data_val);
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-libvirt/libguestfs.git
More information about the Pkg-libvirt-commits
mailing list