daemon stream: Prefer bool over unsigned int var:1

There is no need for doing that since we have a bool type.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
This commit is contained in:
Michal Privoznik 2016-04-04 12:46:19 +02:00
parent 8def0a22a3
commit 5441a25ff6

View File

@ -44,8 +44,8 @@ struct daemonClientStream {
int procedure; int procedure;
unsigned int serial; unsigned int serial;
unsigned int recvEOF : 1; bool recvEOF;
unsigned int closed : 1; bool closed;
int filterID; int filterID;
@ -198,7 +198,7 @@ daemonStreamEvent(virStreamPtr st, int events, void *opaque)
virNetMessagePtr msg; virNetMessagePtr msg;
events &= ~(VIR_STREAM_EVENT_HANGUP); events &= ~(VIR_STREAM_EVENT_HANGUP);
stream->tx = 0; stream->tx = 0;
stream->recvEOF = 1; stream->recvEOF = true;
if (!(msg = virNetMessageNew(false))) { if (!(msg = virNetMessageNew(false))) {
daemonRemoveClientStream(client, stream); daemonRemoveClientStream(client, stream);
virNetServerClientClose(client); virNetServerClientClose(client);
@ -227,7 +227,7 @@ daemonStreamEvent(virStreamPtr st, int events, void *opaque)
virNetMessageError rerr; virNetMessageError rerr;
memset(&rerr, 0, sizeof(rerr)); memset(&rerr, 0, sizeof(rerr));
stream->closed = 1; stream->closed = true;
virStreamEventRemoveCallback(stream->st); virStreamEventRemoveCallback(stream->st);
virStreamAbort(stream->st); virStreamAbort(stream->st);
if (events & VIR_STREAM_EVENT_HANGUP) if (events & VIR_STREAM_EVENT_HANGUP)
@ -538,7 +538,7 @@ daemonStreamHandleWriteData(virNetServerClientPtr client,
memset(&rerr, 0, sizeof(rerr)); memset(&rerr, 0, sizeof(rerr));
VIR_INFO("Stream send failed"); VIR_INFO("Stream send failed");
stream->closed = 1; stream->closed = true;
return virNetServerProgramSendReplyError(stream->prog, return virNetServerProgramSendReplyError(stream->prog,
client, client,
msg, msg,
@ -568,7 +568,7 @@ daemonStreamHandleFinish(virNetServerClientPtr client,
VIR_DEBUG("client=%p, stream=%p, proc=%d, serial=%u", VIR_DEBUG("client=%p, stream=%p, proc=%d, serial=%u",
client, stream, msg->header.proc, msg->header.serial); client, stream, msg->header.proc, msg->header.serial);
stream->closed = 1; stream->closed = true;
virStreamEventRemoveCallback(stream->st); virStreamEventRemoveCallback(stream->st);
ret = virStreamFinish(stream->st); ret = virStreamFinish(stream->st);
@ -608,7 +608,7 @@ daemonStreamHandleAbort(virNetServerClientPtr client,
memset(&rerr, 0, sizeof(rerr)); memset(&rerr, 0, sizeof(rerr));
stream->closed = 1; stream->closed = true;
virStreamEventRemoveCallback(stream->st); virStreamEventRemoveCallback(stream->st);
virStreamAbort(stream->st); virStreamAbort(stream->st);
@ -755,7 +755,7 @@ daemonStreamHandleRead(virNetServerClientPtr client,
virNetMessagePtr msg; virNetMessagePtr msg;
stream->tx = 0; stream->tx = 0;
if (ret == 0) if (ret == 0)
stream->recvEOF = 1; stream->recvEOF = true;
if (!(msg = virNetMessageNew(false))) if (!(msg = virNetMessageNew(false)))
ret = -1; ret = -1;