From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:49781) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1buyMV-00025F-NB for qemu-devel@nongnu.org; Fri, 14 Oct 2016 05:01:08 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1buyMP-0006FZ-Ro for qemu-devel@nongnu.org; Fri, 14 Oct 2016 05:01:07 -0400 Received: from mx1.redhat.com ([209.132.183.28]:45908) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1buyMP-0006FJ-Lh for qemu-devel@nongnu.org; Fri, 14 Oct 2016 05:01:01 -0400 From: Stefan Hajnoczi Date: Fri, 14 Oct 2016 10:00:53 +0100 Message-Id: <1476435656-3100-2-git-send-email-stefanha@redhat.com> In-Reply-To: <1476435656-3100-1-git-send-email-stefanha@redhat.com> References: <1476435656-3100-1-git-send-email-stefanha@redhat.com> Subject: [Qemu-devel] [PATCH v2 1/4] 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: Michael Roth , 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 --- 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; -- 2.7.4