From patchwork Tue Dec 2 16:27:20 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Maciej W. Rozycki" X-Patchwork-Id: 416909 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [IPv6:2001:4830:134:3::11]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 4BAB514011B for ; Wed, 3 Dec 2014 03:27:58 +1100 (AEDT) Received: from localhost ([::1]:37614 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XvqIt-0008Ao-Vq for incoming@patchwork.ozlabs.org; Tue, 02 Dec 2014 11:27:55 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:33529) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XvqIX-0007u6-FJ for qemu-devel@nongnu.org; Tue, 02 Dec 2014 11:27:40 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1XvqIQ-0006vT-Kf for qemu-devel@nongnu.org; Tue, 02 Dec 2014 11:27:33 -0500 Received: from relay1.mentorg.com ([192.94.38.131]:64731) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XvqIQ-0006v5-Fx for qemu-devel@nongnu.org; Tue, 02 Dec 2014 11:27:26 -0500 Received: from nat-ies.mentorg.com ([192.94.31.2] helo=SVR-IES-FEM-01.mgc.mentorg.com) by relay1.mentorg.com with esmtp id 1XvqIN-0002se-Sq from Maciej_Rozycki@mentor.com for qemu-devel@nongnu.org; Tue, 02 Dec 2014 08:27:24 -0800 Received: from localhost (137.202.0.76) by SVR-IES-FEM-01.mgc.mentorg.com (137.202.0.104) with Microsoft SMTP Server (TLS) id 14.3.181.6; Tue, 2 Dec 2014 16:27:22 +0000 Date: Tue, 2 Dec 2014 16:27:20 +0000 From: "Maciej W. Rozycki" To: Message-ID: User-Agent: Alpine 1.10 (DEB 962 2008-03-14) MIME-Version: 1.0 X-detected-operating-system: by eggs.gnu.org: Windows NT kernel [generic] [fuzzy] X-Received-From: 192.94.38.131 Subject: [Qemu-devel] [PATCH] tests: Fix bios-tables-test -Werror compilation error X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Fix: .../tests/bios-tables-test.c: In function 'main': .../tests/bios-tables-test.c:796:11: error: ignoring return value of 'fwrite', declared with attribute warn_unused_result [-Werror=unused-result] cc1: all warnings being treated as errors make: *** [tests/bios-tables-test.o] Error 1 happening when building QEMU with the `--enable-werror' configuration option present. Report any failure from `fwrite'. Signed-off-by: Maciej W. Rozycki --- qemu-test-bios-tables-fwrite.diff Index: qemu-git-trunk/tests/bios-tables-test.c =================================================================== --- qemu-git-trunk.orig/tests/bios-tables-test.c 2014-11-21 11:56:04.000000000 +0000 +++ qemu-git-trunk/tests/bios-tables-test.c 2014-12-02 15:52:27.868971680 +0000 @@ -787,14 +787,21 @@ int main(int argc, char *argv[]) { const char *arch = qtest_get_arch(); FILE *f = fopen(disk, "w"); + size_t s; + int err; int ret; if (!f) { fprintf(stderr, "Couldn't open \"%s\": %s", disk, strerror(errno)); return 1; } - fwrite(boot_sector, 1, sizeof boot_sector, f); + s = fwrite(boot_sector, 1, sizeof boot_sector, f); + err = errno; fclose(f); + if (s != sizeof boot_sector) { + fprintf(stderr, "Couldn't write \"%s\": %s", disk, strerror(err)); + return 1; + } g_test_init(&argc, &argv, NULL);