提交 1baead31 编写于 作者: M Michal Privoznik

virnetserver: Check for virNetServerClientInitKeepAlive() retval

Since it's introduction in v0.9.7-147-gf4324e32 the
virNetServerClientInitKeepAlive() function returned nothing than
a negative one. Fortunately, this did not pose any problem
because we ignored the retval happily. Well, it's time to check
for the retval because the function might fail regularly.
Signed-off-by: NMichal Privoznik <mprivozn@redhat.com>
Reviewed-by: NDaniel P. Berrangé <berrange@redhat.com>
上级 d901fd60
...@@ -306,8 +306,9 @@ int virNetServerAddClient(virNetServerPtr srv, ...@@ -306,8 +306,9 @@ int virNetServerAddClient(virNetServerPtr srv,
virNetServerDispatchNewMessage, virNetServerDispatchNewMessage,
srv); srv);
virNetServerClientInitKeepAlive(client, srv->keepaliveInterval, if (virNetServerClientInitKeepAlive(client, srv->keepaliveInterval,
srv->keepaliveCount); srv->keepaliveCount) < 0)
goto error;
virObjectUnlock(srv); virObjectUnlock(srv);
return 0; return 0;
......
...@@ -1599,7 +1599,7 @@ virNetServerClientInitKeepAlive(virNetServerClientPtr client, ...@@ -1599,7 +1599,7 @@ virNetServerClientInitKeepAlive(virNetServerClientPtr client,
virObjectRef(client); virObjectRef(client);
client->keepalive = ka; client->keepalive = ka;
ret = 0;
cleanup: cleanup:
virObjectUnlock(client); virObjectUnlock(client);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册