mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-02-21 19:02:25 +00:00
test: Remove possible infinite loop in virnetsockettest
Commit 39015a6f3 modified the test to be more reliable/realistic, but without checking the return status of virEventRunDefaultImpl it's possible that the test could run infinitely. Found by Coverity Signed-off-by: John Ferlan <jferlan@redhat.com> ACKed-by: Michal Privoznik <mprivozn@redhat.com>
This commit is contained in:
parent
9ed175fbc2
commit
a0ba31c006
@ -243,8 +243,10 @@ testSocketAccept(const void *opaque)
|
||||
&cdata) < 0)
|
||||
goto cleanup;
|
||||
|
||||
while (rsock == NULL)
|
||||
virEventRunDefaultImpl();
|
||||
while (rsock == NULL) {
|
||||
if (virEventRunDefaultImpl() < 0)
|
||||
break;
|
||||
}
|
||||
|
||||
for (i = 0; i < nlsock; i++) {
|
||||
if (lsock[i] == rsock) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user