From mboxrd@z Thu Jan 1 00:00:00 1970 From: Andrew Jones Subject: Re: [PATCH kvm-unit-tests v2 04/12] scripts/mkstandalone: improve exit paths Date: Thu, 17 Dec 2015 13:15:20 -0600 Message-ID: <20151217191520.GD14168@hawk.localdomain> References: <1450374823-7648-1-git-send-email-rkrcmar@redhat.com> <1450374823-7648-5-git-send-email-rkrcmar@redhat.com> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: QUOTED-PRINTABLE Cc: kvm@vger.kernel.org, Paolo Bonzini To: Radim =?utf-8?B?S3LEjW3DocWZ?= Return-path: Received: from mx1.redhat.com ([209.132.183.28]:43025 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754863AbbLQTP2 (ORCPT ); Thu, 17 Dec 2015 14:15:28 -0500 Received: from int-mx11.intmail.prod.int.phx2.redhat.com (int-mx11.intmail.prod.int.phx2.redhat.com [10.5.11.24]) by mx1.redhat.com (Postfix) with ESMTPS id 8365A3A1175 for ; Thu, 17 Dec 2015 19:15:28 +0000 (UTC) Content-Disposition: inline In-Reply-To: <1450374823-7648-5-git-send-email-rkrcmar@redhat.com> Sender: kvm-owner@vger.kernel.org List-ID: On Thu, Dec 17, 2015 at 06:53:35PM +0100, Radim Kr=C4=8Dm=C3=A1=C5=99 w= rote: > trap can be called on EXIT, which covers most exits. Not with dash :-) If we decide to depend on bash, then Reviewed-by: Andrew Jones >=20 > Signed-off-by: Radim Kr=C4=8Dm=C3=A1=C5=99 > --- > v2: new > =20 > scripts/mkstandalone.sh | 7 ++----- > 1 file changed, 2 insertions(+), 5 deletions(-) >=20 > diff --git a/scripts/mkstandalone.sh b/scripts/mkstandalone.sh > index cf2182dbd936..778383077769 100755 > --- a/scripts/mkstandalone.sh > +++ b/scripts/mkstandalone.sh > @@ -71,7 +71,7 @@ exit 1 > EOF > else > cat <> $standalone > -trap 'rm -f \$bin; exit 1' HUP INT TERM > +trap 'rm -f \$bin' EXIT > bin=3D\`mktemp\` > base64 -d << 'BIN_EOF' | zcat > \$bin && > EOF > @@ -107,10 +107,7 @@ __run() > __eval_log() { eval "\${@}"; } > =20 > run `escape "${@}"` > -ret=3D$? > - > -rm -f \$bin > -exit \$ret > +exit \$? > EOF > fi > chmod +x $standalone > --=20 > 2.6.4 >=20 > -- > To unsubscribe from this list: send the line "unsubscribe kvm" in > the body of a message to majordomo@vger.kernel.org > More majordomo info at http://vger.kernel.org/majordomo-info.html