qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] [PATCH v4 04/10] Add a script to extract VSS SDK header


From: Laszlo Ersek
Subject: Re: [Qemu-devel] [PATCH v4 04/10] Add a script to extract VSS SDK headers on POSIX system
Date: Tue, 25 Jun 2013 10:30:49 +0200
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:17.0) Gecko/20130513 Thunderbird/17.0.6

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 <address@hidden>



reply via email to

[Prev in Thread] Current Thread [Next in Thread]