mirror of https://github.com/xemu-project/xemu.git
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>
This commit is contained in:
parent
91274487a9
commit
b8093d38e8
|
@ -26,13 +26,10 @@ static gboolean ga_channel_listen_accept(GIOChannel *channel,
|
||||||
GAChannel *c = data;
|
GAChannel *c = data;
|
||||||
int ret, client_fd;
|
int ret, client_fd;
|
||||||
bool accepted = false;
|
bool accepted = false;
|
||||||
struct sockaddr_un addr;
|
|
||||||
socklen_t addrlen = sizeof(addr);
|
|
||||||
|
|
||||||
g_assert(channel != NULL);
|
g_assert(channel != NULL);
|
||||||
|
|
||||||
client_fd = qemu_accept(g_io_channel_unix_get_fd(channel),
|
client_fd = qemu_accept(g_io_channel_unix_get_fd(channel), NULL, NULL);
|
||||||
(struct sockaddr *)&addr, &addrlen);
|
|
||||||
if (client_fd == -1) {
|
if (client_fd == -1) {
|
||||||
g_warning("error converting fd to gsocket: %s", strerror(errno));
|
g_warning("error converting fd to gsocket: %s", strerror(errno));
|
||||||
goto out;
|
goto out;
|
||||||
|
|
Loading…
Reference in New Issue