mirror of
https://github.com/opnsense/src.git
synced 2026-04-15 14:29:58 -04:00
* Make 'trap --' do the same as 'trap' instead of nothing. * Make '--' stop option processing (note that '-' action is not an option). Side effect: The error message for an unknown option is different.
19 lines
301 B
Text
19 lines
301 B
Text
# $FreeBSD$
|
|
|
|
set -e
|
|
trap - USR1
|
|
initial=$(trap)
|
|
trap -- -l USR1
|
|
added=$(trap)
|
|
[ -n "$added" ]
|
|
trap - USR1
|
|
second=$(trap)
|
|
[ "$initial" = "$second" ]
|
|
eval "$added"
|
|
added2=$(trap)
|
|
added3=$(trap --)
|
|
[ "$added" = "$added2" ]
|
|
[ "$added2" = "$added3" ]
|
|
trap -- - USR1
|
|
third=$(trap)
|
|
[ "$initial" = "$third" ]
|