[Libguestfs] [PATCH 04/14] daemon: Length of message is a 32 bit unsigned quantity.

Richard W.M. Jones rjones at redhat.com
Tue Jan 24 17:02:18 UTC 2012


From: "Richard W.M. Jones" <rjones at redhat.com>

---
 daemon/proto.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/daemon/proto.c b/daemon/proto.c
index 4ca2b70..ac62a6b 100644
--- a/daemon/proto.c
+++ b/daemon/proto.c
@@ -312,7 +312,7 @@ reply (xdrproc_t xdrp, char *ret)
   char buf[GUESTFS_MESSAGE_MAX];
   char lenbuf[4];
   struct guestfs_message_header hdr;
-  unsigned len;
+  uint32_t len;
 
   xdrmem_create (&xdr, buf, sizeof buf, XDR_ENCODE);
 
@@ -352,7 +352,7 @@ reply (xdrproc_t xdrp, char *ret)
     fprintf (stderr, "guestfsd: xwrite failed\n");
     exit (EXIT_FAILURE);
   }
-  if (xwrite (sock, buf, len) == -1) {
+  if (xwrite (sock, buf, (size_t) len) == -1) {
     fprintf (stderr, "guestfsd: xwrite failed\n");
     exit (EXIT_FAILURE);
   }
-- 
1.7.6




More information about the Libguestfs mailing list