[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



# HG changeset patch
# User Olaf Hering <olaf@xxxxxxxxx>
# Date 1333397572 -7200
# Node ID 3d15aa971865cf18dac45cb70b53b5380604cc8d
# Parent  1a0b5c53a3da2a47a98ec093b296616c4b22d810
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.

v2:
 - add comment about writev use case (see comment about strace in the code)

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

diff -r 1a0b5c53a3da -r 3d15aa971865 tools/libvchan/io.c
--- a/tools/libvchan/io.c
+++ b/tools/libvchan/io.c
@@ -193,7 +193,8 @@ 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);
+               /* Silence gcc warning, will always fail */
+               if (writev(-1, iov, 2));
        }
        if (avail_contig > size)
                avail_contig = size;
@@ -284,7 +285,8 @@ 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);
+               /* Silence gcc warning, will always fail */
+               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®.