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

[Xen-devel] [PATCH 14 of 18] tools/libvchan: fix build errors caused by Werror in io.c


  • To: xen-devel@xxxxxxxxxxxxxxxxxxx
  • From: Olaf Hering <olaf@xxxxxxxxx>
  • Date: Fri, 30 Mar 2012 10:25:31 +0200
  • Delivery-date: Fri, 30 Mar 2012 08:26:01 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xen.org>

# HG changeset patch
# User Olaf Hering <olaf@xxxxxxxxx>
# Date 1333046863 -7200
# Node ID 0966600a98f1b3a4707fa3bfae24d207d424c452
# Parent  bd4bb152538c54457026d3bee6f8b9dba1021b7f
tools/libvchan: fix build errors caused by Werror in io.c

-O2 -Wall -Werror triggers these warnings:

io.c: In function 'do_send':
io.c:196: warning: ignoring return value of 'writev', declared with attribute 
warn_unused_result
io.c: In function 'do_recv':
io.c:287: warning: ignoring return value of 'writev', declared with attribute 
warn_unused_result

writev to -1 will always fail, silence the warning.

Signed-off-by: Olaf Hering <olaf@xxxxxxxxx>

diff -r bd4bb152538c -r 0966600a98f1 tools/libvchan/io.c
--- a/tools/libvchan/io.c
+++ b/tools/libvchan/io.c
@@ -193,7 +193,7 @@ static int do_send(struct libxenvchan *c
                iov[0].iov_len = snprintf(metainfo, 32, "vchan@%p wr", ctrl);
                iov[1].iov_base = (void *)data;
                iov[1].iov_len = size;
-               writev(-1, iov, 2);
+               if (writev(-1, iov, 2));
        }
        if (avail_contig > size)
                avail_contig = size;
@@ -284,7 +284,7 @@ static int do_recv(struct libxenvchan *c
                iov[0].iov_len = snprintf(metainfo, 32, "vchan@%p rd", ctrl);
                iov[1].iov_base = data;
                iov[1].iov_len = size;
-               writev(-1, iov, 2);
+               if (writev(-1, iov, 2));
        }
        if (send_notify(ctrl, VCHAN_NOTIFY_READ))
                return -1;

_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxx
http://lists.xen.org/xen-devel


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.