[libvirt] [PATCH] Cygwin's GCC doesn't like this .sa_handler initialization for some reason
Stefan Berger
stefanb at us.ibm.com
Mon Apr 26 22:46:31 UTC 2010
libvir-list-bounces at 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
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://listman.redhat.com/archives/libvir-list/attachments/20100426/41db5e03/attachment-0001.htm>
More information about the libvir-list
mailing list