Received: from eggs.gnu.org ([2001:4830:134:3::10]:54660) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1c1NR1-0005zw-Lb for qemu-devel@nongnu.org; Mon, 31 Oct 2016 21:00:19 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1c1NQx-0002n1-Qk for qemu-devel@nongnu.org; Mon, 31 Oct 2016 21:00:15 -0400 Received: from mx0b-001b2d01.pphosted.com ([148.163.158.5]:41871 helo=mx0a-001b2d01.pphosted.com) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1c1NQx-0002mi-K0 for qemu-devel@nongnu.org; Mon, 31 Oct 2016 21:00:11 -0400 Received: from pps.filterd (m0098419.ppops.net [127.0.0.1]) by mx0b-001b2d01.pphosted.com (8.16.0.17/8.16.0.17) with SMTP id uA10wq7d019715 for ; Mon, 31 Oct 2016 21:00:11 -0400 Received: from e32.co.us.ibm.com (e32.co.us.ibm.com [32.97.110.150]) by mx0b-001b2d01.pphosted.com with ESMTP id 26efeeuk81-1 (version=TLSv1.2 cipher=AES256-SHA bits=256 verify=NOT) for ; Mon, 31 Oct 2016 21:00:10 -0400 Received: from localhost by e32.co.us.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Mon, 31 Oct 2016 19:00:10 -0600 From: Michael Roth Date: Mon, 31 Oct 2016 19:59:47 -0500 In-Reply-To: <1477961990-20899-1-git-send-email-mdroth@linux.vnet.ibm.com> References: <1477961990-20899-1-git-send-email-mdroth@linux.vnet.ibm.com> Message-Id: <1477961990-20899-3-git-send-email-mdroth@linux.vnet.ibm.com> Subject: [Qemu-devel] [PULL for-2.8 2/5] qga: drop unused sockaddr in accept(2) call List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: peter.maydell@linaro.org, Stefan Hajnoczi From: Stefan Hajnoczi ga_channel_listen_accept() is currently hard-coded to support only AF_UNIX because the struct sockaddr_un type is used. This function should work with any address family. Drop the sockaddr since the client address is unused and is an optional argument to accept(2). Signed-off-by: Stefan Hajnoczi Reviewed-by: Michael Roth Signed-off-by: Michael Roth --- qga/channel-posix.c | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/qga/channel-posix.c b/qga/channel-posix.c index bb65d8b..bf32158 100644 --- a/qga/channel-posix.c +++ b/qga/channel-posix.c @@ -26,13 +26,10 @@ static gboolean ga_channel_listen_accept(GIOChannel *channel, GAChannel *c = data; int ret, client_fd; bool accepted = false; - struct sockaddr_un addr; - socklen_t addrlen = sizeof(addr); g_assert(channel != NULL); - client_fd = qemu_accept(g_io_channel_unix_get_fd(channel), - (struct sockaddr *)&addr, &addrlen); + client_fd = qemu_accept(g_io_channel_unix_get_fd(channel), NULL, NULL); if (client_fd == -1) { g_warning("error converting fd to gsocket: %s", strerror(errno)); goto out; -- 1.9.1