mirror of
https://github.com/libvirt/libvirt.git
synced 2026-10-02 12:20:06 -05: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:
1 parent
9ed175fbc2
commit
a0ba31c006
1 file changed
+4
-2
@@ -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) {
|
||||
|
||||
Reference in new issue
Block a user