From mboxrd@z Thu Jan 1 00:00:00 1970 From: Konstantin Khlebnikov Subject: [PATCH] kvm tools: Plug warning in virtio_p9_wstat() Date: Sun, 10 Jul 2011 16:01:13 +0400 Message-ID: <20110710120113.32717.40442.stgit@localhost6> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: QUOTED-PRINTABLE To: Return-path: Received: from relay.parallels.com ([195.214.232.42]:40178 "EHLO relay.parallels.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755241Ab1GJMBP convert rfc822-to-8bit (ORCPT ); Sun, 10 Jul 2011 08:01:15 -0400 Received: from msk-exch1.sw.swsoft.com ([10.30.1.231] helo=mail.sw.ru) by relay.parallels.com with esmtps (TLSv1:RC4-MD5:128) (Exim 4.74) (envelope-from ) id 1QfshG-0000RW-5J for kvm@vger.kernel.org; Sun, 10 Jul 2011 16:01:14 +0400 Sender: kvm-owner@vger.kernel.org List-ID: glibc declare ftruncate() with attribute warn_unused_result, so result = must be "checked", otherwise we get: virtio/9p.c:487:6: error: variable =E2=80=98res=E2=80=99 set but not us= ed [-Werror=3Dunused-but-set-variable] or virtio/9p.c:496:12: error: ignoring return value of =E2=80=98ftruncate=E2= =80=99, declared with attribute warn_unused_result [-Werror=3Dunused-re= sult] Signed-off-by: Konstantin Khlebnikov --- tools/kvm/virtio/9p.c | 1 + 1 files changed, 1 insertions(+), 0 deletions(-) diff --git a/tools/kvm/virtio/9p.c b/tools/kvm/virtio/9p.c index d927688..4586f66 100644 --- a/tools/kvm/virtio/9p.c +++ b/tools/kvm/virtio/9p.c @@ -495,6 +495,7 @@ static void virtio_p9_wstat(struct p9_dev *p9dev, =20 if (wstat.length !=3D -1UL) res =3D ftruncate(fid->fd, wstat.length); + (void)res; /* To plug the warning. FIXME what if ftruncate fails? */ =20 if (wstat.mode !=3D -1U) chmod(fid->abs_path, wstat.mode & 0xFFFF);