From 21d87d495a78f9207d643a5bf99061d4401370ef Mon Sep 17 00:00:00 2001 From: Denys Vlasenko Date: Fri, 25 Sep 2009 00:06:51 +0200 Subject: ash: better handling of EXIT trap in `trap` hack function old new delta forkchild - 602 +602 trapcmd 255 347 +92 ash_main 1362 1375 +13 evalvar 1371 1373 +2 popstring 140 134 -6 forkshell 835 248 -587 ------------------------------------------------------------------------------ (add/remove: 1/0 grow/shrink: 3/2 up/down: 709/-593) Total: 116 bytes Signed-off-by: Denys Vlasenko --- shell/ash_test/ash-signals/savetrap.right | 5 +++++ shell/ash_test/ash-signals/savetrap.tests | 7 +++++-- 2 files changed, 10 insertions(+), 2 deletions(-) (limited to 'shell/ash_test/ash-signals') diff --git a/shell/ash_test/ash-signals/savetrap.right b/shell/ash_test/ash-signals/savetrap.right index 2d33427..9cfd7a5 100644 --- a/shell/ash_test/ash-signals/savetrap.right +++ b/shell/ash_test/ash-signals/savetrap.right @@ -1,3 +1,8 @@ +trap -- 'echo Exiting' EXIT trap -- 'echo WINCH!' SIGWINCH +trap -- 'echo Exiting' EXIT +trap -- 'echo WINCH!' SIGWINCH +trap -- 'echo Exiting' EXIT trap -- 'echo WINCH!' SIGWINCH Done +Exiting diff --git a/shell/ash_test/ash-signals/savetrap.tests b/shell/ash_test/ash-signals/savetrap.tests index 6492e86..c2b312f 100755 --- a/shell/ash_test/ash-signals/savetrap.tests +++ b/shell/ash_test/ash-signals/savetrap.tests @@ -1,6 +1,9 @@ +trap 'echo Exiting' EXIT trap 'echo WINCH!' SIGWINCH v=` trap ` -echo $v +echo "$v" +v=$( trap ) +echo "$v" v=`trap` -echo $v +echo "$v" echo Done -- cgit v1.1