Roland Mainz wrote: > I didn some debugging on another problem and found an issue related to > signal handling where ksh93 (ast-ksh.2008-02-02) differs from both ksh88 > and bash3: > -- snip -- > $ /usr/bin/ksh93 -c 'printf "#PID=%d\n" $$ ; trap "echo SIGUSR1 ; exit > 0" USR1 ; (trap "" USR1 ; exec kill -USR1 $$ & sleep 10) ; print > "#done."' > #PID=29147 > #done. > $ /usr/bin/ksh -c 'printf "#PID=%d\n" $$ ; trap "echo SIGUSR1 ; exit 0" > USR1 ; (trap "" USR1 ; exec kill -USR1 $$ & sleep 10) ; print > "#done."' #PID=29150 > SIGUSR1 > $ > $ /usr/bin/bash -c 'printf "#PID=%d\n" $$ ; trap "echo SIGUSR1 ; exit 0" > USR1 ; (trap "" USR1 ; exec kill -USR1 $$ & sleep 10) ; print > "#done."' > #PID=29157 > SIGUSR1 > -- snip -- > > Is this the expected behaviour or a bug ?
Short update: IMO the behavious is the expected one. We simply forgot that entering a subshell clears the trap list and triggers the default action for SIGUSR1 (=no-op) in this case. -- snip -- $ ksh93 -c 'printf "#PID=%d\n" $$ ; trap "echo l1_SIGUSR1 ; exit 0" USR1 ; (trap "echo l2_SIGUSR1 ; exit 0" USR1 ; exec kill -USR1 $$ & wait) ; print "#done."' #PID=1375 l2_SIGUSR1 #done. -- snip -- ---- Bye, Roland -- __ . . __ (o.\ \/ /.o) [EMAIL PROTECTED] \__\/\/__/ MPEG specialist, C&&JAVA&&Sun&&Unix programmer /O /==\ O\ TEL +49 641 7950090 (;O/ \/ \O;) _______________________________________________ ast-developers mailing list [email protected] https://mailman.research.att.com/mailman/listinfo/ast-developers
