From patchwork Mon Feb 14 19:11:36 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Wolfgang Denk X-Patchwork-Id: 83150 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from theia.denx.de (theia.denx.de [85.214.87.163]) by ozlabs.org (Postfix) with ESMTP id 84B59B7103 for ; Tue, 15 Feb 2011 06:11:54 +1100 (EST) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 4A6A428080; Mon, 14 Feb 2011 20:11:51 +0100 (CET) X-Virus-Scanned: Debian amavisd-new at theia.denx.de Received: from theia.denx.de ([127.0.0.1]) by localhost (theia.denx.de [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id a5LS0ERkxzPs; Mon, 14 Feb 2011 20:11:51 +0100 (CET) Received: from theia.denx.de (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id E239B28078; Mon, 14 Feb 2011 20:11:49 +0100 (CET) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 0C40928078 for ; Mon, 14 Feb 2011 20:11:48 +0100 (CET) X-Virus-Scanned: Debian amavisd-new at theia.denx.de Received: from theia.denx.de ([127.0.0.1]) by localhost (theia.denx.de [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id Nz1NGXrwtSds for ; Mon, 14 Feb 2011 20:11:46 +0100 (CET) X-policyd-weight: NOT_IN_SBL_XBL_SPAMHAUS=-1.5 NOT_IN_SPAMCOP=-1.5 NOT_IN_BL_NJABL=-1.5 (only DNSBL check requested) Received: from mail-out.m-online.net (mail-out.m-online.net [212.18.0.9]) by theia.denx.de (Postfix) with ESMTP id 0B27328077 for ; Mon, 14 Feb 2011 20:11:44 +0100 (CET) Received: from frontend1.mail.m-online.net (unknown [192.168.8.180]) by mail-out.m-online.net (Postfix) with ESMTP id 30F461C01EE9 for ; Mon, 14 Feb 2011 20:11:44 +0100 (CET) X-Auth-Info: iMNqQuoLJZc1WMaiQmdddAd411NaYfy6xpeytMiJfy0= Received: from diddl.denx.de (host-80-81-18-216.customer.m-online.net [80.81.18.216]) by smtp-auth.mnet-online.de (Postfix) with ESMTPA id 2AA951C00105 for ; Mon, 14 Feb 2011 20:11:44 +0100 (CET) Received: from gemini.denx.de (gemini.denx.de [10.0.0.2]) by diddl.denx.de (Postfix) with ESMTP id DCAA43096C20 for ; Mon, 14 Feb 2011 20:11:43 +0100 (CET) Received: by gemini.denx.de (Postfix, from userid 500) id C3C30151B54; Mon, 14 Feb 2011 20:11:43 +0100 (CET) From: Wolfgang Denk To: u-boot@lists.denx.de Date: Mon, 14 Feb 2011 20:11:36 +0100 Message-Id: <1297710697-13872-1-git-send-email-wd@denx.de> X-Mailer: git-send-email 1.7.4 Subject: [U-Boot] [PATCH 1/2] hush: Only run list if it's not empty X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.9 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: u-boot-bounces@lists.denx.de Errors-To: u-boot-bounces@lists.denx.de Running empty lists causes wrong return status Adapted from Barebox commit 4596d2b Author: Sascha Hauer Date: Thu Sep 17 11:11:51 2009 +0200 Signed-off-by: Wolfgang Denk --- common/hush.c | 7 ++++++- 1 files changed, 6 insertions(+), 1 deletions(-) diff --git a/common/hush.c b/common/hush.c index 8021a68..c6f8392 100644 --- a/common/hush.c +++ b/common/hush.c @@ -3178,7 +3178,12 @@ int parse_stream_outer(struct in_str *inp, int flag) #ifndef __U_BOOT__ run_list(ctx.list_head); #else - code = run_list(ctx.list_head); + if (ctx.list_head->num_progs) { + code = run_list(ctx.list_head); + } else { + free_pipe_list(ctx.list_head, 0); + continue; + } if (code == -2) { /* exit */ b_free(&temp); code = 0;