---
src/rpc/virnetclient.c | 12 ++++++------
src/rpc/virnetclientprogram.c | 12 ++++++------
src/rpc/virnetmessage.c | 6 +++---
src/rpc/virnetserver.c | 26 +++++++++++++-------------
src/rpc/virnetserverclient.c | 4 ++--
src/rpc/virnetserverprogram.c | 2 +-
src/rpc/virnetserverservice.c | 14 +++++++-------
src/rpc/virnetsocket.c | 2 +-
8 files changed, 39 insertions(+), 39 deletions(-)
diff --git a/src/rpc/virnetclient.c b/src/rpc/virnetclient.c
index 1d228f0..d87c7e3 100644
--- a/src/rpc/virnetclient.c
+++ b/src/rpc/virnetclient.c
@@ -602,7 +602,7 @@ void virNetClientDispose(void *obj)
if (client->closeFf)
client->closeFf(client->closeOpaque);
- for (i = 0 ; i < client->nprograms ; i++)
+ for (i = 0; i < client->nprograms; i++)
virObjectUnref(client->programs[i]);
VIR_FREE(client->programs);
@@ -916,7 +916,7 @@ void virNetClientRemoveStream(virNetClientPtr client,
{
virObjectLock(client);
size_t i;
- for (i = 0 ; i < client->nstreams ; i++) {
+ for (i = 0; i < client->nstreams; i++) {
if (client->streams[i] == st)
break;
}
@@ -1008,7 +1008,7 @@ static int virNetClientCallDispatchMessage(virNetClientPtr client)
size_t i;
virNetClientProgramPtr prog = NULL;
- for (i = 0 ; i < client->nprograms ; i++) {
+ for (i = 0; i < client->nprograms; i++) {
if (virNetClientProgramMatches(client->programs[i],
&client->msg)) {
prog = client->programs[i];
@@ -1033,7 +1033,7 @@ static int virNetClientCallDispatchStream(virNetClientPtr client)
virNetClientCallPtr thecall;
/* First identify what stream this packet is directed at */
- for (i = 0 ; i < client->nstreams ; i++) {
+ for (i = 0; i < client->nstreams; i++) {
if (virNetClientStreamMatches(client->streams[i],
&client->msg)) {
st = client->streams[i];
@@ -1175,7 +1175,7 @@ virNetClientIOWriteMessage(virNetClientPtr client,
if (thecall->msg->bufferOffset == thecall->msg->bufferLength) {
size_t i;
- for (i = thecall->msg->donefds ; i < thecall->msg->nfds ; i++) {
+ for (i = thecall->msg->donefds; i < thecall->msg->nfds; i++) {
int rv;
if ((rv = virNetSocketSendFD(client->sock, thecall->msg->fds[i]))
< 0)
return -1;
@@ -1297,7 +1297,7 @@ virNetClientIOHandleInput(virNetClientPtr client)
virNetMessageDecodeNumFDs(&client->msg) < 0)
return -1;
- for (i = client->msg.donefds ; i < client->msg.nfds ; i++)
{
+ for (i = client->msg.donefds; i < client->msg.nfds; i++) {
int rv;
if ((rv = virNetSocketRecvFD(client->sock,
&(client->msg.fds[i]))) < 0)
return -1;
diff --git a/src/rpc/virnetclientprogram.c b/src/rpc/virnetclientprogram.c
index 2e6e4f6..1016f55 100644
--- a/src/rpc/virnetclientprogram.c
+++ b/src/rpc/virnetclientprogram.c
@@ -197,7 +197,7 @@ static virNetClientProgramEventPtr
virNetClientProgramGetEvent(virNetClientProgr
{
int i;
- for (i = 0 ; i < prog->nevents ; i++) {
+ for (i = 0; i < prog->nevents; i++) {
if (prog->events[i].proc == procedure)
return &prog->events[i];
}
@@ -301,9 +301,9 @@ int virNetClientProgramCall(virNetClientProgramPtr prog,
virReportOOMError();
goto error;
}
- for (i = 0 ; i < msg->nfds ; i++)
+ for (i = 0; i < msg->nfds; i++)
msg->fds[i] = -1;
- for (i = 0 ; i < msg->nfds ; i++) {
+ for (i = 0; i < msg->nfds; i++) {
if ((msg->fds[i] = dup(outfds[i])) < 0) {
virReportSystemError(errno,
_("Cannot duplicate FD %d"),
@@ -362,9 +362,9 @@ int virNetClientProgramCall(virNetClientProgramPtr prog,
virReportOOMError();
goto error;
}
- for (i = 0 ; i < *ninfds ; i++)
+ for (i = 0; i < *ninfds; i++)
(*infds)[i] = -1;
- for (i = 0 ; i < *ninfds ; i++) {
+ for (i = 0; i < *ninfds; i++) {
if (((*infds)[i] = dup(msg->fds[i])) < 0) {
virReportSystemError(errno,
_("Cannot duplicate FD %d"),
@@ -401,7 +401,7 @@ int virNetClientProgramCall(virNetClientProgramPtr prog,
error:
virNetMessageFree(msg);
if (infds && ninfds) {
- for (i = 0 ; i < *ninfds ; i++)
+ for (i = 0; i < *ninfds; i++)
VIR_FORCE_CLOSE((*infds)[i]);
}
return -1;
diff --git a/src/rpc/virnetmessage.c b/src/rpc/virnetmessage.c
index b2c6e5b..85c831d 100644
--- a/src/rpc/virnetmessage.c
+++ b/src/rpc/virnetmessage.c
@@ -55,7 +55,7 @@ void virNetMessageClear(virNetMessagePtr msg)
VIR_DEBUG("msg=%p nfds=%zu", msg, msg->nfds);
- for (i = 0 ; i < msg->nfds ; i++)
+ for (i = 0; i < msg->nfds; i++)
VIR_FORCE_CLOSE(msg->fds[i]);
VIR_FREE(msg->fds);
VIR_FREE(msg->buffer);
@@ -75,7 +75,7 @@ void virNetMessageFree(virNetMessagePtr msg)
if (msg->cb)
msg->cb(msg, msg->opaque);
- for (i = 0 ; i < msg->nfds ; i++)
+ for (i = 0; i < msg->nfds; i++)
VIR_FORCE_CLOSE(msg->fds[i]);
VIR_FREE(msg->buffer);
VIR_FREE(msg->fds);
@@ -325,7 +325,7 @@ int virNetMessageDecodeNumFDs(virNetMessagePtr msg)
virReportOOMError();
goto cleanup;
}
- for (i = 0 ; i < msg->nfds ; i++)
+ for (i = 0; i < msg->nfds; i++)
msg->fds[i] = -1;
VIR_DEBUG("Got %zu FDs from peer", msg->nfds);
diff --git a/src/rpc/virnetserver.c b/src/rpc/virnetserver.c
index e536cc3..94b27f0 100644
--- a/src/rpc/virnetserver.c
+++ b/src/rpc/virnetserver.c
@@ -210,7 +210,7 @@ static int virNetServerDispatchNewMessage(virNetServerClientPtr
client,
srv, client, msg);
virObjectLock(srv);
- for (i = 0 ; i < srv->nprograms ; i++) {
+ for (i = 0; i < srv->nprograms; i++) {
if (virNetServerProgramMatches(srv->programs[i], msg)) {
prog = srv->programs[i];
break;
@@ -517,7 +517,7 @@ virNetServerPtr virNetServerNewPostExecRestart(virJSONValuePtr
object,
goto error;
}
- for (i = 0 ; i < n ; i++) {
+ for (i = 0; i < n; i++) {
virNetServerServicePtr service;
virJSONValuePtr child = virJSONValueArrayGet(services, i);
if (!child) {
@@ -550,7 +550,7 @@ virNetServerPtr virNetServerNewPostExecRestart(virJSONValuePtr
object,
goto error;
}
- for (i = 0 ; i < n ; i++) {
+ for (i = 0; i < n; i++) {
virNetServerClientPtr client;
virJSONValuePtr child = virJSONValueArrayGet(clients, i);
if (!child) {
@@ -645,7 +645,7 @@ virJSONValuePtr virNetServerPreExecRestart(virNetServerPtr srv)
goto error;
}
- for (i = 0 ; i < srv->nservices ; i++) {
+ for (i = 0; i < srv->nservices; i++) {
virJSONValuePtr child;
if (!(child = virNetServerServicePreExecRestart(srv->services[i])))
goto error;
@@ -662,7 +662,7 @@ virJSONValuePtr virNetServerPreExecRestart(virNetServerPtr srv)
goto error;
}
- for (i = 0 ; i < srv->nclients ; i++) {
+ for (i = 0; i < srv->nclients; i++) {
virJSONValuePtr child;
if (!(child = virNetServerClientPreExecRestart(srv->clients[i])))
goto error;
@@ -870,7 +870,7 @@ virNetServerSignalEvent(int watch,
goto cleanup;
}
- for (i = 0 ; i < srv->nsignals ; i++) {
+ for (i = 0; i < srv->nsignals; i++) {
if (siginfo.si_signo == srv->signals[i]->signum) {
virNetServerSignalFunc func = srv->signals[i]->func;
void *funcopaque = srv->signals[i]->opaque;
@@ -1051,7 +1051,7 @@ void virNetServerUpdateServices(virNetServerPtr srv,
int i;
virObjectLock(srv);
- for (i = 0 ; i < srv->nservices ; i++)
+ for (i = 0; i < srv->nservices; i++)
virNetServerServiceToggle(srv->services[i], enabled);
virObjectUnlock(srv);
@@ -1113,7 +1113,7 @@ void virNetServerRun(virNetServerPtr srv)
virObjectLock(srv);
reprocess:
- for (i = 0 ; i < srv->nclients ; i++) {
+ for (i = 0; i < srv->nclients; i++) {
/* Coverity 5.3.0 couldn't see that srv->clients is non-NULL
* if srv->nclients is non-zero. */
sa_assert(srv->clients);
@@ -1162,12 +1162,12 @@ void virNetServerDispose(void *obj)
VIR_FORCE_CLOSE(srv->autoShutdownInhibitFd);
- for (i = 0 ; i < srv->nservices ; i++)
+ for (i = 0; i < srv->nservices; i++)
virNetServerServiceToggle(srv->services[i], false);
virThreadPoolFree(srv->workers);
- for (i = 0 ; i < srv->nsignals ; i++) {
+ for (i = 0; i < srv->nsignals; i++) {
sigaction(srv->signals[i]->signum, &srv->signals[i]->oldaction,
NULL);
VIR_FREE(srv->signals[i]);
}
@@ -1177,15 +1177,15 @@ void virNetServerDispose(void *obj)
if (srv->sigwatch > 0)
virEventRemoveHandle(srv->sigwatch);
- for (i = 0 ; i < srv->nservices ; i++)
+ for (i = 0; i < srv->nservices; i++)
virObjectUnref(srv->services[i]);
VIR_FREE(srv->services);
- for (i = 0 ; i < srv->nprograms ; i++)
+ for (i = 0; i < srv->nprograms; i++)
virObjectUnref(srv->programs[i]);
VIR_FREE(srv->programs);
- for (i = 0 ; i < srv->nclients ; i++) {
+ for (i = 0; i < srv->nclients; i++) {
virNetServerClientClose(srv->clients[i]);
virObjectUnref(srv->clients[i]);
}
diff --git a/src/rpc/virnetserverclient.c b/src/rpc/virnetserverclient.c
index 6d7c439..7232191 100644
--- a/src/rpc/virnetserverclient.c
+++ b/src/rpc/virnetserverclient.c
@@ -1166,7 +1166,7 @@ readmore:
}
/* Try getting the file descriptors (may fail if blocking) */
- for (i = msg->donefds ; i < msg->nfds ; i++) {
+ for (i = msg->donefds; i < msg->nfds; i++) {
int rv;
if ((rv = virNetSocketRecvFD(client->sock, &(msg->fds[i]))) < 0)
{
virNetMessageQueueServe(&client->rx);
@@ -1317,7 +1317,7 @@ virNetServerClientDispatchWrite(virNetServerClientPtr client)
virNetMessagePtr msg;
size_t i;
- for (i = client->tx->donefds ; i < client->tx->nfds ; i++) {
+ for (i = client->tx->donefds; i < client->tx->nfds; i++) {
int rv;
if ((rv = virNetSocketSendFD(client->sock, client->tx->fds[i]))
< 0) {
client->wantClose = true;
diff --git a/src/rpc/virnetserverprogram.c b/src/rpc/virnetserverprogram.c
index b80923d..09d4d21 100644
--- a/src/rpc/virnetserverprogram.c
+++ b/src/rpc/virnetserverprogram.c
@@ -451,7 +451,7 @@ virNetServerProgramDispatchCall(virNetServerProgramPtr prog,
*
*/
if (rv != 1) {
- for (i = 0 ; i < msg->nfds ; i++)
+ for (i = 0; i < msg->nfds; i++)
VIR_FORCE_CLOSE(msg->fds[i]);
VIR_FREE(msg->fds);
msg->nfds = 0;
diff --git a/src/rpc/virnetserverservice.c b/src/rpc/virnetserverservice.c
index 2915355..baf0ebe 100644
--- a/src/rpc/virnetserverservice.c
+++ b/src/rpc/virnetserverservice.c
@@ -121,7 +121,7 @@ virNetServerServicePtr virNetServerServiceNewTCP(const char
*nodename,
&svc->nsocks) < 0)
goto error;
- for (i = 0 ; i < svc->nsocks ; i++) {
+ for (i = 0; i < svc->nsocks; i++) {
if (virNetSocketListen(svc->socks[i], 0) < 0)
goto error;
@@ -184,7 +184,7 @@ virNetServerServicePtr virNetServerServiceNewUNIX(const char *path,
&svc->socks[0]) < 0)
goto error;
- for (i = 0 ; i < svc->nsocks ; i++) {
+ for (i = 0; i < svc->nsocks; i++) {
if (virNetSocketListen(svc->socks[i], 0) < 0)
goto error;
@@ -243,7 +243,7 @@ virNetServerServicePtr virNetServerServiceNewFD(int fd,
&svc->socks[0]) < 0)
goto error;
- for (i = 0 ; i < svc->nsocks ; i++) {
+ for (i = 0; i < svc->nsocks; i++) {
/* IO callback is initially disabled, until we're ready
* to deal with incoming clients */
if (virNetSocketAddIOCallback(svc->socks[i],
@@ -315,7 +315,7 @@ virNetServerServicePtr
virNetServerServiceNewPostExecRestart(virJSONValuePtr obj
goto error;
}
- for (i = 0 ; i < svc->nsocks ; i++) {
+ for (i = 0; i < svc->nsocks; i++) {
virJSONValuePtr child = virJSONValueArrayGet(socks, i);
virNetSocketPtr sock;
@@ -372,7 +372,7 @@ virJSONValuePtr
virNetServerServicePreExecRestart(virNetServerServicePtr svc)
goto error;
}
- for (i = 0 ; i < svc->nsocks ; i++) {
+ for (i = 0; i < svc->nsocks; i++) {
virJSONValuePtr child;
if (!(child = virNetSocketPreExecRestart(svc->socks[i])))
goto error;
@@ -437,7 +437,7 @@ void virNetServerServiceDispose(void *obj)
virNetServerServicePtr svc = obj;
int i;
- for (i = 0 ; i < svc->nsocks ; i++)
+ for (i = 0; i < svc->nsocks; i++)
virObjectUnref(svc->socks[i]);
VIR_FREE(svc->socks);
@@ -451,7 +451,7 @@ void virNetServerServiceToggle(virNetServerServicePtr svc,
{
int i;
- for (i = 0 ; i < svc->nsocks ; i++)
+ for (i = 0; i < svc->nsocks; i++)
virNetSocketUpdateIOCallback(svc->socks[i],
enabled ?
VIR_EVENT_HANDLE_READABLE :
diff --git a/src/rpc/virnetsocket.c b/src/rpc/virnetsocket.c
index 67eb496..2474003 100644
--- a/src/rpc/virnetsocket.c
+++ b/src/rpc/virnetsocket.c
@@ -321,7 +321,7 @@ int virNetSocketNewListenTCP(const char *nodename,
return 0;
error:
- for (i = 0 ; i < nsocks ; i++)
+ for (i = 0; i < nsocks; i++)
virObjectUnref(socks[i]);
VIR_FREE(socks);
freeaddrinfo(ai);
--
1.8.1.4