daemon/Win32: Use xdr_u_int for PortableXDR compatibility.
[libguestfs.git] / daemon / guestfsd.c
index eab8529..f31f1f2 100644 (file)
@@ -51,6 +51,11 @@ static char *read_cmdline (void);
 #define GUESTFWD_ADDR "10.0.2.4"
 #define GUESTFWD_PORT "6666"
 
+/* This is only a hint.  If not defined, ignore it. */
+#ifndef AI_ADDRCONFIG
+#define AI_ADDRCONFIG 0
+#endif
+
 int verbose = 0;
 
 static int print_shell_quote (FILE *stream, const struct printf_info *info, const void *const *args);
@@ -152,6 +157,7 @@ main (int argc, char *argv[])
       printf ("could not read linux command line\n");
   }
 
+#ifndef WIN32
   /* Make sure SIGPIPE doesn't kill us. */
   struct sigaction sa;
   memset (&sa, 0, sizeof sa);
@@ -159,6 +165,7 @@ main (int argc, char *argv[])
   sa.sa_flags = 0;
   if (sigaction (SIGPIPE, &sa, NULL) == -1)
     perror ("sigaction SIGPIPE"); /* but try to continue anyway ... */
+#endif
 
   /* Set up a basic environment.  After we are called by /init the
    * environment is essentially empty.
@@ -304,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);