提交 a0ba31c0 编写于 作者: J John Ferlan

test: Remove possible infinite loop in virnetsockettest

Commit 39015a6f 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: NJohn Ferlan <jferlan@redhat.com>
ACKed-by: NMichal Privoznik <mprivozn@redhat.com>
上级 9ed175fb
......@@ -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) {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册