Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
[4.2/4.3] Bug with wait and trapped signals
- X-seq: zsh-workers 22276
- From: Vincent Lefevre <vincent@xxxxxxxxxx>
- To: zsh-workers@xxxxxxxxxx
- Subject: [4.2/4.3] Bug with wait and trapped signals
- Date: Fri, 17 Feb 2006 15:28:16 +0100
- Mail-followup-to: zsh-workers@xxxxxxxxxx
- Mailing-list: contact zsh-workers-help@xxxxxxxxxx; run by ezmlm
zsh (all versions?) does not interrupt a "wait" when it receives
a signal for which a trap has been set.
For instance, consider the following script:
#!/usr/bin/env zsh
echo "PID = $$"
sleep 60 &
trap 'echo term; exit 0' TERM
wait
When I send SIGTERM to the shell process, zsh does nothing, waiting
for the child to terminate before executing the trap. POSIX says:
2.11 Signals and Error Handling
[...] When the shell is waiting, by means of the wait utility, for
asynchronous commands to complete, the reception of a signal for
which a trap has been set shall cause the wait utility to return
immediately with an exit status >128, immediately after which the
trap associated with that signal shall be taken.
http://www.opengroup.org/onlinepubs/009695399/utilities/xcu_chap02.html#tag_02_11
--
Vincent Lefèvre <vincent@xxxxxxxxxx> - Web: <http://www.vinc17.org/>
100% accessible validated (X)HTML - Blog: <http://www.vinc17.org/blog/>
Work: CR INRIA - computer arithmetic / SPACES project at LORIA
Messages sorted by:
Reverse Date,
Date,
Thread,
Author