Richard W.M. Jones
2009-Nov-25 15:02 UTC
[Libguestfs] [PATCH] daemon/Win32: Use xdr_u_int for PortableXDR compatibility.
-- Richard Jones, Virtualization Group, Red Hat http://people.redhat.com/~rjones Read my programming blog: http://rwmj.wordpress.com Fedora now supports 80 OCaml packages (the OPEN alternative to F#) http://cocan.org/getting_started_with_ocaml_on_red_hat_and_fedora -------------- next part -------------->From 100fc211d672da2ef0adc81f65ec9903346c6d8c Mon Sep 17 00:00:00 2001From: Richard Jones <rjones at redhat.com> Date: Wed, 25 Nov 2009 14:45:20 +0000 Subject: [PATCH 3/7] daemon/Win32: Use xdr_u_int for PortableXDR compatibility. PortableXDR didn't support xdr_uint32_t. xdr_u_int is the same type. --- daemon/guestfsd.c | 2 +- daemon/proto.c | 14 +++++++------- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/daemon/guestfsd.c b/daemon/guestfsd.c index 67206d0..f31f1f2 100644 --- a/daemon/guestfsd.c +++ b/daemon/guestfsd.c @@ -311,7 +311,7 @@ main (int argc, char *argv[]) XDR xdr; uint32_t len = GUESTFS_LAUNCH_FLAG; xdrmem_create (&xdr, lenbuf, sizeof lenbuf, XDR_ENCODE); - xdr_uint32_t (&xdr, &len); + xdr_u_int (&xdr, &len); if (xwrite (sock, lenbuf, sizeof lenbuf) == -1) exit (EXIT_FAILURE); diff --git a/daemon/proto.c b/daemon/proto.c index 4106d92..2231037 100644 --- a/daemon/proto.c +++ b/daemon/proto.c @@ -67,7 +67,7 @@ main_loop (int _sock) exit (EXIT_FAILURE); xdrmem_create (&xdr, lenbuf, 4, XDR_DECODE); - xdr_uint32_t (&xdr, &len); + xdr_u_int (&xdr, &len); xdr_destroy (&xdr); if (len > GUESTFS_MESSAGE_MAX) { @@ -233,7 +233,7 @@ send_error (const char *msg) xdr_destroy (&xdr); xdrmem_create (&xdr, lenbuf, 4, XDR_ENCODE); - xdr_uint32_t (&xdr, &len); + xdr_u_int (&xdr, &len); xdr_destroy (&xdr); if (xwrite (sock, lenbuf, 4) == -1) { @@ -285,7 +285,7 @@ reply (xdrproc_t xdrp, char *ret) xdr_destroy (&xdr); xdrmem_create (&xdr, lenbuf, 4, XDR_ENCODE); - xdr_uint32_t (&xdr, &len); + xdr_u_int (&xdr, &len); xdr_destroy (&xdr); if (xwrite (sock, lenbuf, 4) == -1) { @@ -315,7 +315,7 @@ receive_file (receive_cb cb, void *opaque) exit (EXIT_FAILURE); xdrmem_create (&xdr, lenbuf, 4, XDR_DECODE); - xdr_uint32_t (&xdr, &len); + xdr_u_int (&xdr, &len); xdr_destroy (&xdr); if (len == GUESTFS_CANCEL_FLAG) @@ -380,7 +380,7 @@ cancel_receive (void) uint32_t flag = GUESTFS_CANCEL_FLAG; xdrmem_create (&xdr, fbuf, sizeof fbuf, XDR_ENCODE); - xdr_uint32_t (&xdr, &flag); + xdr_u_int (&xdr, &flag); xdr_destroy (&xdr); if (xwrite (sock, fbuf, sizeof fbuf) == -1) { @@ -455,7 +455,7 @@ check_for_library_cancellation (void) return 0; xdrmem_create (&xdr, buf, sizeof buf, XDR_DECODE); - xdr_uint32_t (&xdr, &flag); + xdr_u_int (&xdr, &flag); xdr_destroy (&xdr); if (flag != GUESTFS_CANCEL_FLAG) { @@ -497,7 +497,7 @@ send_chunk (const guestfs_chunk *chunk) xdr_destroy (&xdr); xdrmem_create (&xdr, lenbuf, 4, XDR_ENCODE); - xdr_uint32_t (&xdr, &len); + xdr_u_int (&xdr, &len); xdr_destroy (&xdr); int err = (xwrite (sock, lenbuf, 4) == 0 -- 1.6.5.2
Jim Meyering
2009-Nov-25 17:56 UTC
[Libguestfs] [PATCH] daemon/Win32: Use xdr_u_int for PortableXDR compatibility.
Richard W.M. Jones wrote:> Subject: [PATCH 3/7] daemon/Win32: Use xdr_u_int for PortableXDR compatibility. > > PortableXDR didn't support xdr_uint32_t. xdr_u_int is the same type.It looks to me like xdr_uint32_t is the preferred name, because it is more descriptive. If so, can you do something like this instead? #define xdr_uint32_t xdr_u_int or use a typedef?> diff --git a/daemon/guestfsd.c b/daemon/guestfsd.c > index 67206d0..f31f1f2 100644 > --- a/daemon/guestfsd.c > +++ b/daemon/guestfsd.c > @@ -311,7 +311,7 @@ main (int argc, char *argv[]) > XDR xdr; > uint32_t len = GUESTFS_LAUNCH_FLAG; > xdrmem_create (&xdr, lenbuf, sizeof lenbuf, XDR_ENCODE); > - xdr_uint32_t (&xdr, &len); > + xdr_u_int (&xdr, &len); > > if (xwrite (sock, lenbuf, sizeof lenbuf) == -1) > exit (EXIT_FAILURE); > diff --git a/daemon/proto.c b/daemon/proto.c > index 4106d92..2231037 100644 > --- a/daemon/proto.c > +++ b/daemon/proto.c > @@ -67,7 +67,7 @@ main_loop (int _sock) > exit (EXIT_FAILURE); > > xdrmem_create (&xdr, lenbuf, 4, XDR_DECODE); > - xdr_uint32_t (&xdr, &len); > + xdr_u_int (&xdr, &len);...