From patchwork Tue Jan 19 23:56:16 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Juan Quintela X-Patchwork-Id: 43247 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 59E54B7CD9 for ; Wed, 20 Jan 2010 11:19:23 +1100 (EST) Received: from localhost ([127.0.0.1]:45257 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1NXOCB-000302-6A for incoming@patchwork.ozlabs.org; Tue, 19 Jan 2010 19:13:15 -0500 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1NXNwJ-0005tZ-CH for qemu-devel@nongnu.org; Tue, 19 Jan 2010 18:56:51 -0500 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1NXNwE-0005pD-2c for qemu-devel@nongnu.org; Tue, 19 Jan 2010 18:56:49 -0500 Received: from [199.232.76.173] (port=59382 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1NXNwD-0005p7-DN for qemu-devel@nongnu.org; Tue, 19 Jan 2010 18:56:45 -0500 Received: from mx1.redhat.com ([209.132.183.28]:1025) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1NXNwC-0005wK-Pd for qemu-devel@nongnu.org; Tue, 19 Jan 2010 18:56:45 -0500 Received: from int-mx08.intmail.prod.int.phx2.redhat.com (int-mx08.intmail.prod.int.phx2.redhat.com [10.5.11.21]) by mx1.redhat.com (8.13.8/8.13.8) with ESMTP id o0JNuhar031697 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Tue, 19 Jan 2010 18:56:44 -0500 Received: from localhost.localdomain (ovpn01.gateway.prod.ext.phx2.redhat.com [10.5.9.1]) by int-mx08.intmail.prod.int.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id o0JNuT3q027975; Tue, 19 Jan 2010 18:56:42 -0500 From: Juan Quintela To: qemu-devel@nongnu.org Date: Wed, 20 Jan 2010 00:56:16 +0100 Message-Id: <92f176f89cc9190ad8bf4d30ebe9ee75982474fa.1263944807.git.quintela@redhat.com> In-Reply-To: References: In-Reply-To: References: X-Scanned-By: MIMEDefang 2.67 on 10.5.11.21 X-detected-operating-system: by monty-python.gnu.org: Genre and OS details not recognized. Cc: kirill@shutemov.name Subject: [Qemu-devel] [PATCH 09/17] net/slirp.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 From: Kirill A. Shutemov CC net/slirp.o cc1: warnings being treated as errors net/slirp.c: In function 'slirp_smb_cleanup': net/slirp.c:470: error: ignoring return value of 'system', declared with attribute warn_unused_result make: *** [net/slirp.o] Error 1 Signed-off-by: Kirill A. Shutemov Signed-off-by: Juan Quintela --- net/slirp.c | 9 ++++++++- 1 files changed, 8 insertions(+), 1 deletions(-) diff --git a/net/slirp.c b/net/slirp.c index 3f91c4b..b75ad16 100644 --- a/net/slirp.c +++ b/net/slirp.c @@ -464,10 +464,17 @@ int net_slirp_redir(const char *redir_str) static void slirp_smb_cleanup(SlirpState *s) { char cmd[128]; + int ret; if (s->smb_dir[0] != '\0') { snprintf(cmd, sizeof(cmd), "rm -rf %s", s->smb_dir); - system(cmd); + ret = system(cmd); + if (!WIFEXITED(ret)) { + qemu_error("'%s' failed.\n", cmd); + } else if (WEXITSTATUS(ret)) { + qemu_error("'%s' failed. Error code: %d\n", + cmd, WEXITSTATUS(ret)); + } s->smb_dir[0] = '\0'; } }