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:
John Ferlan 2018-09-07 08:20:15 -04:00
parent 9ed175fbc2
commit a0ba31c006

View File

@ -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) {