[Spice-devel,Xspice,06/11] vmc_read: rename variable "read" to "nbytes"

Submitted by Uri Lublin on Jan. 26, 2015, 10:35 a.m.

Details

Message ID 3a81e5faf0d386885d81ec3f03ad644b93ac0250.1422267879.git.uril@redhat.com
State New
Headers show

Not browsing as part of any series.

Commit Message

Uri Lublin Jan. 26, 2015, 10:35 a.m.
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(-)

Patch hide | download patch | download mbox

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)