From owner-svn-ports-head@FreeBSD.ORG Sat Oct 4 21:39:05 2014 Return-Path: Delivered-To: svn-ports-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 6327311B; Sat, 4 Oct 2014 21:39:05 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4E777944; Sat, 4 Oct 2014 21:39:05 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id s94Ld57o089468; Sat, 4 Oct 2014 21:39:05 GMT (envelope-from nox@FreeBSD.org) Received: (from nox@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s94Ld4hr089463; Sat, 4 Oct 2014 21:39:04 GMT (envelope-from nox@FreeBSD.org) Message-Id: <201410042139.s94Ld4hr089463@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: nox set sender to nox@FreeBSD.org using -f From: Juergen Lock Date: Sat, 4 Oct 2014 21:39:04 +0000 (UTC) To: ports-committers@freebsd.org, svn-ports-all@freebsd.org, svn-ports-head@freebsd.org Subject: svn commit: r369997 - in head/emulators/qemu-devel: . files X-SVN-Group: ports-head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-ports-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the ports tree for head List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 04 Oct 2014 21:39:05 -0000 Author: nox Date: Sat Oct 4 21:39:04 2014 New Revision: 369997 URL: https://svnweb.freebsd.org/changeset/ports/369997 QAT: https://qat.redports.org/buildarchive/r369997/ Log: - bsd-user: fix sendmsg(2) emulation w/o ancillary data. - Bump PORTREVISION. Submitted by: sbruno Obtained from: https://github.com/seanbruno/qemu-bsd-user/commit/ad92220df37d1ab3120316fcc436071c78817561 Added: head/emulators/qemu-devel/files/extra-patch-ad92220df37d1ab3120316fcc436071c78817561 (contents, props changed) Modified: head/emulators/qemu-devel/Makefile Modified: head/emulators/qemu-devel/Makefile ============================================================================== --- head/emulators/qemu-devel/Makefile Sat Oct 4 21:38:08 2014 (r369996) +++ head/emulators/qemu-devel/Makefile Sat Oct 4 21:39:04 2014 (r369997) @@ -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- 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 Added: head/emulators/qemu-devel/files/extra-patch-ad92220df37d1ab3120316fcc436071c78817561 ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/emulators/qemu-devel/files/extra-patch-ad92220df37d1ab3120316fcc436071c78817561 Sat Oct 4 21:39:04 2014 (r369997) @@ -0,0 +1,59 @@ +From ad92220df37d1ab3120316fcc436071c78817561 Mon Sep 17 00:00:00 2001 +From: Sean Bruno +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) {