[PATCH 3/9] daemon stream: Convert @tx in daemonClientStream to bool

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



This structure item is used as pure boolean. There's no need to
hold whole integer for it.

Signed-off-by: Michal Privoznik <mprivozn@xxxxxxxxxx>
---
 daemon/stream.c | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/daemon/stream.c b/daemon/stream.c
index 2a9e6e4..a2a370c 100644
--- a/daemon/stream.c
+++ b/daemon/stream.c
@@ -50,7 +50,7 @@ struct daemonClientStream {
     int filterID;
 
     virNetMessagePtr rx;
-    int tx;
+    bool tx;
 
     daemonClientStreamPtr next;
 };
@@ -99,7 +99,7 @@ daemonStreamMessageFinished(virNetMessagePtr msg,
     VIR_DEBUG("stream=%p proc=%d serial=%u",
               stream, msg->header.proc, msg->header.serial);
 
-    stream->tx = 1;
+    stream->tx = true;
     daemonStreamUpdateEvents(stream);
 
     daemonFreeClientStream(NULL, stream);
@@ -197,7 +197,7 @@ daemonStreamEvent(virStreamPtr st, int events, void *opaque)
         (events & VIR_STREAM_EVENT_HANGUP)) {
         virNetMessagePtr msg;
         events &= ~(VIR_STREAM_EVENT_HANGUP);
-        stream->tx = 0;
+        stream->tx = false;
         stream->recvEOF = true;
         if (!(msg = virNetMessageNew(false))) {
             daemonRemoveClientStream(client, stream);
@@ -422,7 +422,7 @@ int daemonAddClientStream(virNetServerClientPtr client,
     }
 
     if (transmit)
-        stream->tx = 1;
+        stream->tx = true;
 
     virMutexLock(&priv->lock);
     stream->next = priv->streams;
@@ -753,7 +753,7 @@ daemonStreamHandleRead(virNetServerClientPtr client,
                                                      stream->serial);
     } else {
         virNetMessagePtr msg;
-        stream->tx = 0;
+        stream->tx = false;
         if (ret == 0)
             stream->recvEOF = true;
         if (!(msg = virNetMessageNew(false)))
-- 
2.7.3

--
libvir-list mailing list
libvir-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/libvir-list



[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]