aboutsummaryrefslogtreecommitdiff
path: root/emulators/qemu-devel
diff options
context:
space:
mode:
authorJuergen Lock <nox@FreeBSD.org>2014-10-04 21:39:04 +0000
committerJuergen Lock <nox@FreeBSD.org>2014-10-04 21:39:04 +0000
commit90a40bb73bff677416b5dbfc625fa90c753fbef4 (patch)
treeacc1a418344fd5a004bf3322dbc9c91ba30153e4 /emulators/qemu-devel
parent01c0b8c01cd7ce6059d04ed6f8a9661618465392 (diff)
downloadports-90a40bb73bff677416b5dbfc625fa90c753fbef4.tar.gz
ports-90a40bb73bff677416b5dbfc625fa90c753fbef4.zip
Notes
Diffstat (limited to 'emulators/qemu-devel')
-rw-r--r--emulators/qemu-devel/Makefile3
-rw-r--r--emulators/qemu-devel/files/extra-patch-ad92220df37d1ab3120316fcc436071c7881756159
2 files changed, 61 insertions, 1 deletions
diff --git a/emulators/qemu-devel/Makefile b/emulators/qemu-devel/Makefile
index 7d982ea00006..352907d166bb 100644
--- a/emulators/qemu-devel/Makefile
+++ b/emulators/qemu-devel/Makefile
@@ -3,7 +3,7 @@
PORTNAME= qemu
PORTVERSION= 2.0.2
-PORTREVISION= 3
+PORTREVISION= 4
CATEGORIES= emulators
MASTER_SITES= http://wiki.qemu.org/download/:release \
LOCAL/nox:snapshot
@@ -79,6 +79,7 @@ EXTRA_PATCHES+= ${FILESDIR}/extra-patch-21927cffcc7bcacbb953155f778200846df9f60e
EXTRA_PATCHES+= ${FILESDIR}/extra-patch-bsd-user-freebsd-os-sys.c
EXTRA_PATCHES+= ${FILESDIR}/extra-patch-sysctl-hw-physmem
EXTRA_PATCHES+= ${FILESDIR}/extra-patch-max-arg-pages
+EXTRA_PATCHES+= ${FILESDIR}/extra-patch-ad92220df37d1ab3120316fcc436071c78817561
.endif
CONFIGURE_ARGS+= --extra-ldflags=-L${LOCALBASE}/lib
diff --git a/emulators/qemu-devel/files/extra-patch-ad92220df37d1ab3120316fcc436071c78817561 b/emulators/qemu-devel/files/extra-patch-ad92220df37d1ab3120316fcc436071c78817561
new file mode 100644
index 000000000000..c627b9be892b
--- /dev/null
+++ b/emulators/qemu-devel/files/extra-patch-ad92220df37d1ab3120316fcc436071c78817561
@@ -0,0 +1,59 @@
+From ad92220df37d1ab3120316fcc436071c78817561 Mon Sep 17 00:00:00 2001
+From: Sean Bruno <sbruno@chips.ysv.freebsd.org>
+Date: Sat, 4 Oct 2014 20:36:32 +0000
+Subject: [PATCH] Ancillary data in the msghdr struct is optional, not
+ mandatory.
+
+If it doesn't exist, that's ok sendmsg() anyway. Fixes pkg repo
+issues now that pkg uses sendmsg.
+---
+ bsd-user/freebsd/os-socket.h | 22 +++++++++++++++++-----
+ 1 file changed, 17 insertions(+), 5 deletions(-)
+
+diff --git a/bsd-user/freebsd/os-socket.h b/bsd-user/freebsd/os-socket.h
+index 9339ffb..a5f5ca7 100644
+--- a/bsd-user/freebsd/os-socket.h
++++ b/bsd-user/freebsd/os-socket.h
+@@ -54,9 +54,15 @@ static inline abi_long do_freebsd_sendmsg(int fd, abi_ulong target_msg,
+ msg.msg_name = NULL;
+ msg.msg_namelen = 0;
+ }
+- msg.msg_controllen = 2 * tswapal(msgp->msg_controllen);
+- msg.msg_control = alloca(msg.msg_controllen);
+- msg.msg_flags = tswap32(msgp->msg_flags);
++ if (tswapal(msgp->msg_controllen) > 0) {
++ msg.msg_controllen = 2 * tswapal(msgp->msg_controllen);
++ msg.msg_control = alloca(msg.msg_controllen);
++ msg.msg_flags = tswap32(msgp->msg_flags);
++ } else {
++ msg.msg_controllen = 0;
++ msg.msg_control = NULL;
++ msg.msg_flags = 0;
++ }
+
+ count = tswapal(msgp->msg_iovlen);
+ vec = alloca(count * sizeof(struct iovec));
+@@ -65,7 +71,10 @@ static inline abi_long do_freebsd_sendmsg(int fd, abi_ulong target_msg,
+ msg.msg_iovlen = count;
+ msg.msg_iov = vec;
+
+- ret = t2h_freebsd_cmsg(&msg, msgp);
++ if (msg.msg_controllen > 0)
++ ret = t2h_freebsd_cmsg(&msg, msgp);
++ else /* no ancillary data */
++ ret = 0;
+ if (!is_error(ret)) {
+ ret = get_errno(sendmsg(fd, &msg, flags));
+ }
+@@ -116,7 +125,10 @@ static inline abi_long do_freebsd_recvmsg(int fd, abi_ulong target_msg,
+ ret = get_errno(recvmsg(fd, &msg, flags));
+ if (!is_error(ret)) {
+ len = ret;
+- ret = h2t_freebsd_cmsg(msgp, &msg);
++ if (msg.msg_controllen > 0)
++ ret = h2t_freebsd_cmsg(msgp, &msg);
++ else /* no ancillary data */
++ ret = 0;
+ if (!is_error(ret)) {
+ msgp->msg_namelen = tswap32(msg.msg_namelen);
+ if (msg.msg_name != NULL) {