mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-04 08:13:54 -06:00
qtest: Assure that init_socket()'s listen() does not fail
In practice this seems very unlikely, so cleanup is neglected, as done for bind(). Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com> Signed-off-by: Andreas Färber <afaerber@suse.de>
This commit is contained in:
parent
4688c94c1f
commit
a7ded163db
1 changed files with 2 additions and 1 deletions
|
@ -72,7 +72,8 @@ static int init_socket(const char *socket_path)
|
||||||
ret = bind(sock, (struct sockaddr *)&addr, sizeof(addr));
|
ret = bind(sock, (struct sockaddr *)&addr, sizeof(addr));
|
||||||
} while (ret == -1 && errno == EINTR);
|
} while (ret == -1 && errno == EINTR);
|
||||||
g_assert_no_errno(ret);
|
g_assert_no_errno(ret);
|
||||||
listen(sock, 1);
|
ret = listen(sock, 1);
|
||||||
|
g_assert_no_errno(ret);
|
||||||
|
|
||||||
return sock;
|
return sock;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue