From patchwork Sat Jan 2 03:45:27 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Kirill A . Shutemov" X-Patchwork-Id: 41999 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [199.232.76.165]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id 7AA84B6EEA for ; Sat, 2 Jan 2010 14:58:56 +1100 (EST) Received: from localhost ([127.0.0.1]:54731 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1NQv8f-0002fg-4p for incoming@patchwork.ozlabs.org; Fri, 01 Jan 2010 22:58:53 -0500 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1NQuw7-0006Zv-T8 for qemu-devel@nongnu.org; Fri, 01 Jan 2010 22:45:56 -0500 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1NQuw3-0006XP-2Q for qemu-devel@nongnu.org; Fri, 01 Jan 2010 22:45:55 -0500 Received: from [199.232.76.173] (port=53814 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1NQuw2-0006XH-Tu for qemu-devel@nongnu.org; Fri, 01 Jan 2010 22:45:50 -0500 Received: from mail-fx0-f222.google.com ([209.85.220.222]:55673) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1NQuw2-00082i-Nm for qemu-devel@nongnu.org; Fri, 01 Jan 2010 22:45:50 -0500 Received: by mail-fx0-f222.google.com with SMTP id 22so16659813fxm.2 for ; Fri, 01 Jan 2010 19:45:50 -0800 (PST) Received: by 10.223.97.155 with SMTP id l27mr14805516fan.91.1262403950174; Fri, 01 Jan 2010 19:45:50 -0800 (PST) Received: from localhost.localdomain (a88-114-220-92.elisa-laajakaista.fi [88.114.220.92]) by mx.google.com with ESMTPS id 35sm22820386fkt.40.2010.01.01.19.45.48 (version=SSLv3 cipher=RC4-MD5); Fri, 01 Jan 2010 19:45:49 -0800 (PST) From: "Kirill A. Shutemov" To: qemu-devel@nongnu.org Date: Sat, 2 Jan 2010 05:45:27 +0200 Message-Id: <1262403933-26881-9-git-send-email-kirill@shutemov.name> X-Mailer: git-send-email 1.6.5.7 In-Reply-To: <1262403933-26881-8-git-send-email-kirill@shutemov.name> References: <1262403933-26881-1-git-send-email-kirill@shutemov.name> <1262403933-26881-2-git-send-email-kirill@shutemov.name> <1262403933-26881-3-git-send-email-kirill@shutemov.name> <1262403933-26881-4-git-send-email-kirill@shutemov.name> <1262403933-26881-5-git-send-email-kirill@shutemov.name> <1262403933-26881-6-git-send-email-kirill@shutemov.name> <1262403933-26881-7-git-send-email-kirill@shutemov.name> <1262403933-26881-8-git-send-email-kirill@shutemov.name> X-detected-operating-system: by monty-python.gnu.org: GNU/Linux 2.6 (newer, 2) Cc: "Kirill A. Shutemov" Subject: [Qemu-devel] [PATCH 09/15] usb-linux.c: fix warning with _FORTIFY_SOURCE X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org CC usb-linux.o cc1: warnings being treated as errors usb-linux.c: In function 'usb_host_read_file': usb-linux.c:1204: error: ignoring return value of 'fgets', declared with attribute warn_unused_result make: *** [usb-linux.o] Error 1 Signed-off-by: Kirill A. Shutemov --- usb-linux.c | 8 ++++++-- 1 files changed, 6 insertions(+), 2 deletions(-) diff --git a/usb-linux.c b/usb-linux.c index 88728e9..8673474 100644 --- a/usb-linux.c +++ b/usb-linux.c @@ -1201,9 +1201,13 @@ static int usb_host_read_file(char *line, size_t line_size, const char *device_f device_file); f = fopen(filename, "r"); if (f) { - fgets(line, line_size, f); + if (fgets(line, line_size, f)) { + ret = 1; + } else { + ret = 0; + } + fclose(f); - ret = 1; #if 0 } else { if (mon)