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() {
8282
8383 ___global_trap_table___[" $signal_spec " ]=" $new_trap_handlers "
8484
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
9094 done
9195}
9296
You can’t perform that action at this time.
0 commit comments