File tree Expand file tree Collapse file tree 1 file changed +9
-5
lines changed Expand file tree Collapse file tree 1 file changed +9
-5
lines changed Original file line number Diff line number Diff line change @@ -82,11 +82,15 @@ core.trap_remove() {
82
82
83
83
___global_trap_table___[" $signal_spec " ]=" $new_trap_handlers "
84
84
85
- # rho (WET)
86
- local global_trap_handler_name=
87
- printf -v global_trap_handler_name ' %q' " core.private.trap_handler_${signal_spec} "
88
-
89
- unset -f " $global_trap_handler_name "
85
+ # If there are no more user-provided trap-handlers (for the particular signal spec in the global trap table),
86
+ # then remove our handler from 'trap'
87
+ if [ -z " $new_trap_handlers " ]; then
88
+ # rho (WET)
89
+ local global_trap_handler_name=
90
+ printf -v global_trap_handler_name ' %q' " core.private.trap_handler_${signal_spec} "
91
+ trap -- " $signal_spec "
92
+ unset -f " $global_trap_handler_name "
93
+ fi
90
94
done
91
95
}
92
96
You can’t perform that action at this time.
0 commit comments