summary refs log tree commit diff stats
path: root/qga/channel-posix.c
diff options
context:
space:
mode:
authorStefan Hajnoczi <stefanha@redhat.com>2016-10-14 10:00:53 +0100
committerMichael Roth <mdroth@linux.vnet.ibm.com>2016-10-31 19:21:22 -0500
commitb8093d38e8dce0413fe8999fe2dee48a96ab1104 (patch)
treefe9edb2fbf43ce581bf3d58a4cb01c020a77f18b /qga/channel-posix.c
parent91274487a979b693c264be35b2ffcb703f0a104e (diff)
downloadfocaccia-qemu-b8093d38e8dce0413fe8999fe2dee48a96ab1104.tar.gz
focaccia-qemu-b8093d38e8dce0413fe8999fe2dee48a96ab1104.zip
qga: drop unused sockaddr in accept(2) call
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 <stefanha@redhat.com>
Reviewed-by: Michael Roth <mdroth@linux.vnet.ibm.com>
Signed-off-by: Michael Roth <mdroth@linux.vnet.ibm.com>
Diffstat (limited to 'qga/channel-posix.c')
-rw-r--r--qga/channel-posix.c5
1 files changed, 1 insertions, 4 deletions
diff --git a/qga/channel-posix.c b/qga/channel-posix.c
index bb65d8ba17..bf321584ce 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;