From mboxrd@z Thu Jan 1 00:00:00 1970 From: Olaf Hering Subject: [PATCH 14 of 18] tools/libvchan: fix build errors caused by Werror in io.c Date: Mon, 02 Apr 2012 22:15:37 +0200 Message-ID: <3d15aa971865cf18dac4.1333397737@probook.site> References: Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org To: xen-devel@lists.xensource.com Cc: Ian Jackson List-Id: xen-devel@lists.xenproject.org # HG changeset patch # User Olaf Hering # 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 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;