[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]

Re: [libvirt] [PATCH] Cygwin's GCC doesn't like this .sa_handler initialization for some reason




libvir-list-bounces redhat com wrote on 04/26/2010 03:20:47 PM:


> > static struct sigaction zero_sigaction = {0};
> > struct sigaction action_stop = zero_sigaction;
> > action_stop.sa_handler = stop;
> >
> > But don't go changing this commit just for that theoretical platform.
> >
>
> Thanks, pushed.
>


Does it compile for you on cygwin?

I need to make the following changes just to get it to link properly:


diff --git a/src/Makefile.am b/src/Makefile.am
index fc64927..723d221 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -928,7 +928,7 @@ libvirt.def: libvirt.syms
 libvirt_la_SOURCES =
 libvirt_la_LIBADD += \
                     $(CYGWIN_EXTRA_LIBADD) ../gnulib/lib/libgnu.la
-libvirt_la_LDFLAGS = $(VERSION_SCRIPT_FLAGS)$(LIBVIRT_SYMBOL_FILE) \
+libvirt_la_LDFLAGS = \
                      -version-info $(LIBVIRT_VERSION_INFO) \
                     $(COVERAGE_CFLAGS:-f%=-Wc,-f%) \
                     $(LIBXML_LIBS) \
diff --git a/src/remote/remote_protocol.c b/src/remote/remote_protocol.c
index c9816dd..854b0fd 100644
--- a/src/remote/remote_protocol.c
+++ b/src/remote/remote_protocol.c
@@ -413,12 +413,12 @@ xdr_remote_node_get_info_ret (XDR *xdrs, remote_node_get_info_ret *objp)
                          if (!xdr_int (xdrs, &objp->threads))
                                  return FALSE;
                 } else {
-                        (void)IXDR_PUT_INT32(buf, objp->cpus);
-                        (void)IXDR_PUT_INT32(buf, objp->mhz);
-                        (void)IXDR_PUT_INT32(buf, objp->nodes);
-                        (void)IXDR_PUT_INT32(buf, objp->sockets);
-                        (void)IXDR_PUT_INT32(buf, objp->cores);
-                        (void)IXDR_PUT_INT32(buf, objp->threads);
+                        (void)IXDR_PUT_LONG(buf, objp->cpus);
+                        (void)IXDR_PUT_LONG(buf, objp->mhz);
+                        (void)IXDR_PUT_LONG(buf, objp->nodes);
+                        (void)IXDR_PUT_LONG(buf, objp->sockets);
+                        (void)IXDR_PUT_LONG(buf, objp->cores);
+                        (void)IXDR_PUT_LONG(buf, objp->threads);
                 }
                 return TRUE;
         } else if (xdrs->x_op == XDR_DECODE) {
@@ -442,12 +442,12 @@ xdr_remote_node_get_info_ret (XDR *xdrs, remote_node_get_info_ret *objp)
                          if (!xdr_int (xdrs, &objp->threads))
                                  return FALSE;
                 } else {
-                        objp->cpus = IXDR_GET_INT32(buf);
-                        objp->mhz = IXDR_GET_INT32(buf);
-                        objp->nodes = IXDR_GET_INT32(buf);
-                        objp->sockets = IXDR_GET_INT32(buf);
-                        objp->cores = IXDR_GET_INT32(buf);
-                        objp->threads = IXDR_GET_INT32(buf);
+                        objp->cpus = IXDR_GET_LONG(buf);
+                        objp->mhz = IXDR_GET_LONG(buf);
+                        objp->nodes = IXDR_GET_LONG(buf);
+                        objp->sockets = IXDR_GET_LONG(buf);
+                        objp->cores = IXDR_GET_LONG(buf);
+                        objp->threads = IXDR_GET_LONG(buf);
                 }
          return TRUE;
         }

Virsh doesn't work then, but at least it links after these changes.

  Stefan

[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]