From patchwork Sun Dec 20 01:39:26 2009 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Kirill A. Shutemov" X-Patchwork-Id: 41503 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 52876B6F17 for ; Sun, 20 Dec 2009 13:06:47 +1100 (EST) Received: from localhost ([127.0.0.1]:43881 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1NMBC0-0003ZH-55 for incoming@patchwork.ozlabs.org; Sat, 19 Dec 2009 21:06:44 -0500 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1NMAmF-0008Au-9F for qemu-devel@nongnu.org; Sat, 19 Dec 2009 20:40:07 -0500 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1NMAm9-00085l-AD for qemu-devel@nongnu.org; Sat, 19 Dec 2009 20:40:05 -0500 Received: from [199.232.76.173] (port=54485 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1NMAm8-000852-Bf for qemu-devel@nongnu.org; Sat, 19 Dec 2009 20:40:00 -0500 Received: from mail-fx0-f222.google.com ([209.85.220.222]:53674) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1NMAm8-0004mU-0m for qemu-devel@nongnu.org; Sat, 19 Dec 2009 20:40:00 -0500 Received: by mail-fx0-f222.google.com with SMTP id 22so4042055fxm.2 for ; Sat, 19 Dec 2009 17:39:59 -0800 (PST) Received: by 10.223.68.155 with SMTP id v27mr7525893fai.10.1261273199645; Sat, 19 Dec 2009 17:39:59 -0800 (PST) Received: from localhost.localdomain (a88-114-220-92.elisa-laajakaista.fi [88.114.220.92]) by mx.google.com with ESMTPS id 13sm6982256fks.45.2009.12.19.17.39.58 (version=SSLv3 cipher=RC4-MD5); Sat, 19 Dec 2009 17:39:58 -0800 (PST) From: "Kirill A. Shutemov" To: qemu-devel@nongnu.org Date: Sun, 20 Dec 2009 03:39:26 +0200 Message-Id: <1261273167-3240-17-git-send-email-kirill@shutemov.name> X-Mailer: git-send-email 1.6.5.6 In-Reply-To: <1261273167-3240-16-git-send-email-kirill@shutemov.name> References: <1261273167-3240-1-git-send-email-kirill@shutemov.name> <1261273167-3240-2-git-send-email-kirill@shutemov.name> <1261273167-3240-3-git-send-email-kirill@shutemov.name> <1261273167-3240-4-git-send-email-kirill@shutemov.name> <1261273167-3240-5-git-send-email-kirill@shutemov.name> <1261273167-3240-6-git-send-email-kirill@shutemov.name> <1261273167-3240-7-git-send-email-kirill@shutemov.name> <1261273167-3240-8-git-send-email-kirill@shutemov.name> <1261273167-3240-9-git-send-email-kirill@shutemov.name> <1261273167-3240-10-git-send-email-kirill@shutemov.name> <1261273167-3240-11-git-send-email-kirill@shutemov.name> <1261273167-3240-12-git-send-email-kirill@shutemov.name> <1261273167-3240-13-git-send-email-kirill@shutemov.name> <1261273167-3240-14-git-send-email-kirill@shutemov.name> <1261273167-3240-15-git-send-email-kirill@shutemov.name> <1261273167-3240-16-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 17/18] path.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 libuser/path.o cc1: warnings being treated as errors /usr/src/RPM/BUILD/qemu-0.11.92/path.c: In function 'new_entry': /usr/src/RPM/BUILD/qemu-0.11.92/path.c:49: error: ignoring return value of 'asprintf', declared with attribute warn_unused_result make[1]: *** [path.o] Error 1 Signed-off-by: Kirill A. Shutemov --- path.c | 5 ++++- 1 files changed, 4 insertions(+), 1 deletions(-) diff --git a/path.c b/path.c index cc9e007..0d2bf14 100644 --- a/path.c +++ b/path.c @@ -46,7 +46,10 @@ static struct pathelem *new_entry(const char *root, { struct pathelem *new = malloc(sizeof(*new)); new->name = strdup(name); - asprintf(&new->pathname, "%s/%s", root, name); + if (asprintf(&new->pathname, "%s/%s", root, name) == -1) { + printf("Cannot allocate memory\n"); + exit(1); + } new->num_entries = 0; return new; }