From patchwork Fri Jun 22 09:40:02 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Stefan Hajnoczi X-Patchwork-Id: 166558 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id E97A2B6F86 for ; Fri, 22 Jun 2012 19:42:05 +1000 (EST) Received: from localhost ([::1]:35030 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Si0NP-0008Aw-NO for incoming@patchwork.ozlabs.org; Fri, 22 Jun 2012 05:42:03 -0400 Received: from eggs.gnu.org ([208.118.235.92]:59696) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Si0M0-0005dk-0F for qemu-devel@nongnu.org; Fri, 22 Jun 2012 05:40:41 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Si0Lu-0005Fi-S3 for qemu-devel@nongnu.org; Fri, 22 Jun 2012 05:40:35 -0400 Received: from e06smtp13.uk.ibm.com ([195.75.94.109]:34889) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Si0Lu-0005BG-Cc for qemu-devel@nongnu.org; Fri, 22 Jun 2012 05:40:30 -0400 Received: from /spool/local by e06smtp13.uk.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Fri, 22 Jun 2012 10:40:26 +0100 Received: from d06nrmr1507.portsmouth.uk.ibm.com (9.149.38.233) by e06smtp13.uk.ibm.com (192.168.101.143) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; Fri, 22 Jun 2012 10:40:14 +0100 Received: from d06av11.portsmouth.uk.ibm.com (d06av11.portsmouth.uk.ibm.com [9.149.37.252]) by d06nrmr1507.portsmouth.uk.ibm.com (8.13.8/8.13.8/NCO v10.0) with ESMTP id q5M9eD7G1958108 for ; Fri, 22 Jun 2012 10:40:13 +0100 Received: from d06av11.portsmouth.uk.ibm.com (loopback [127.0.0.1]) by d06av11.portsmouth.uk.ibm.com (8.14.4/8.13.1/NCO v10.0 AVout) with ESMTP id q5M9eDJH018192 for ; Fri, 22 Jun 2012 03:40:13 -0600 Received: from localhost (stefanha-thinkpad.manchester-maybrook.uk.ibm.com [9.174.219.145]) by d06av11.portsmouth.uk.ibm.com (8.14.4/8.13.1/NCO v10.0 AVin) with ESMTP id q5M9eCkS018187; Fri, 22 Jun 2012 03:40:12 -0600 From: Stefan Hajnoczi To: Anthony Liguori Date: Fri, 22 Jun 2012 10:40:02 +0100 Message-Id: <1340358009-16033-6-git-send-email-stefanha@linux.vnet.ibm.com> X-Mailer: git-send-email 1.7.10 In-Reply-To: <1340358009-16033-1-git-send-email-stefanha@linux.vnet.ibm.com> References: <1340358009-16033-1-git-send-email-stefanha@linux.vnet.ibm.com> MIME-Version: 1.0 x-cbid: 12062209-2966-0000-0000-0000047C9111 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 195.75.94.109 Cc: =?UTF-8?q?Andreas=20F=C3=A4rber?= , qemu-devel@nongnu.org, Stefan Hajnoczi Subject: [Qemu-devel] [PATCH 05/12] libqtest: Fix socket_accept() to pass address_len X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org From: Andreas Färber accept() expects address_len to point to the length of the sockaddr on input. Initialize it accordingly. Resolves an assertion due to EFAULT on illumos. Signed-off-by: Andreas Färber Signed-off-by: Stefan Hajnoczi --- tests/libqtest.c | 1 + 1 file changed, 1 insertion(+) diff --git a/tests/libqtest.c b/tests/libqtest.c index 6d333ef..1d73fd1 100644 --- a/tests/libqtest.c +++ b/tests/libqtest.c @@ -74,6 +74,7 @@ static int socket_accept(int sock) socklen_t addrlen; int ret; + addrlen = sizeof(addr); do { ret = accept(sock, (struct sockaddr *)&addr, &addrlen); } while (ret == -1 && errno == EINTR);