[Xspice PATCH 06/11] vmc_read: rename variable "read" to "nbytes"

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

 



This fixes the following compiler warning.
spiceqxl_vdagent.c:49: warning: declaration of ‘read’ shadows a global declaration
/usr/include/unistd.h:357: warning: shadowed declaration is here
---
 src/spiceqxl_vdagent.c |    8 ++++----
 1 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/src/spiceqxl_vdagent.c b/src/spiceqxl_vdagent.c
index ba04cb8..4208233 100644
--- a/src/spiceqxl_vdagent.c
+++ b/src/spiceqxl_vdagent.c
@@ -46,13 +46,13 @@ static int vmc_write(SpiceCharDeviceInstance *sin, const uint8_t *buf, int len)
 
 static int vmc_read(SpiceCharDeviceInstance *sin, uint8_t *buf, int len)
 {
-    int read;
+    int nbytes;
 
     if (virtio_client_fd == -1) {
         return 0;
     }
-    read = recv(virtio_client_fd, buf, len, 0);
-    if (read <= 0) {
+    nbytes = recv(virtio_client_fd, buf, len, 0);
+    if (nbytes <= 0) {
         if (errno == EAGAIN || errno == EWOULDBLOCK || errno == EINTR) {
             return 0;
         }
@@ -62,7 +62,7 @@ static int vmc_read(SpiceCharDeviceInstance *sin, uint8_t *buf, int len)
         vdagent_sin.qxl->core->watch_remove(virtio_client_watch);
         virtio_client_watch = NULL;
     }
-    return read;
+    return nbytes;
 }
 
 static void on_read_available(int fd, int event, void *opaque)
-- 
1.7.1

_______________________________________________
Spice-devel mailing list
Spice-devel@xxxxxxxxxxxxxxxxxxxxx
http://lists.freedesktop.org/mailman/listinfo/spice-devel





[Index of Archives]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [IETF Annouce]     [Security]     [Bugtraq]     [Linux]     [Linux OMAP]     [Linux MIPS]     [ECOS]     [Asterisk Internet PBX]     [Linux API]     [Monitors]