Skip to content

Commit

Permalink
rbenv-rehash: remove superfluous trap signals
Browse files Browse the repository at this point in the history
A trap on the special signal EXIT is executed before the shell
terminates. EXIT actually covers SIGINT and SIGTERM as well, and
we don't need any extra traps for them.

See bash(1) and "help trap" in bash.
  • Loading branch information
mlafeldt committed Nov 14, 2011
1 parent 4cc6665 commit 0324b11
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion libexec/rbenv-rehash
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ set +o noclobber

# If we were able to obtain a lock, register a trap to clean up the
# prototype shim when the process exits.
trap remove_prototype_shim SIGINT SIGTERM EXIT
trap remove_prototype_shim EXIT

remove_prototype_shim() {
rm -f "$PROTOTYPE_SHIM_PATH"
Expand Down

0 comments on commit 0324b11

Please sign in to comment.