From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:43160) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UrOcM-0007P0-53 for qemu-devel@nongnu.org; Tue, 25 Jun 2013 04:28:54 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1UrOc9-0007Ai-K1 for qemu-devel@nongnu.org; Tue, 25 Jun 2013 04:28:50 -0400 Received: from mx1.redhat.com ([209.132.183.28]:41321) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UrOc9-0007AZ-9J for qemu-devel@nongnu.org; Tue, 25 Jun 2013 04:28:37 -0400 Message-ID: <51C95539.9060102@redhat.com> Date: Tue, 25 Jun 2013 10:30:49 +0200 From: Laszlo Ersek MIME-Version: 1.0 References: <20130606150618.10486.60669.stgit@hds.com> <20130606150638.10486.36820.stgit@hds.com> In-Reply-To: <20130606150638.10486.36820.stgit@hds.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH v4 04/10] Add a script to extract VSS SDK headers on POSIX system List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Tomoki Sekiyama Cc: libaiqing@huawei.com, mdroth@linux.vnet.ibm.com, stefanha@gmail.com, qemu-devel@nongnu.org, lcapitulino@redhat.com, vrozenfe@redhat.com, Paolo Bonzini , seiji.aguchi@hds.com, areis@redhat.com On 06/06/13 17:06, Tomoki Sekiyama wrote: > +tmpdir=$(mktemp -d) > +trap "rm -fr $tmpdir vsssdk.msi; exit 1" HUP INT QUIT ALRM TERM "mktemp" keys off TMPDIR, so I would prefer something like (note the single quotes -- $tmpdir is expanded at trap execution time): trap 'rm -fr -- "$tmpdir"' but whoever starts TMPDIR with a dash, or puts whitespace in it, deserves what's coming to him. Also sigpsec in "trap" could have been EXIT -- then you could have omitted the final cleanup on the success path. The "exit 1" is not necessary; AFAIR the trap handler doesn't change the exit status that the shell has decided for otherwise (IOW exit status of the trap handler should be suppressed anyway). Placing an "exit 1" in the trap handler could even be detrimental somewhat, since it might mess with WIFSIGNALED() / WTERMSIG() that would otherwise tell a parent shell to interrupt the parent script. http://www.cons.org/cracauer/sigint.html I've said nothing substantial. I wish I could go into such detail when reviewing the real meat of the series... Reviewed-by: Laszlo Ersek