Subject: bin/619: /bin/sh give error message when executing trap 0 script
To: None <gnats-admin@sun-lamp.cs.berkeley.edu>
From: None <woods@spinne.web.net>
List: netbsd-bugs
Date: 12/07/1994 11:35:05
>Number:         619
>Category:       bin
>Synopsis:       /bin/sh give error message when executing trap 0 script
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    bin-bug-people (Utility Bug People)
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Wed Dec  7 11:35:02 1994
>Originator:     Greg A. Woods
>Organization:
Nirv Community Resource Centre, Inc.
>Release:        1.0
>Environment:

System: NetBSD spinne 1.0 NetBSD 1.0 (SPINNE) #27: Mon Nov 14 14:48:08 EST 1994 david@spinne:/home/src/sys/arch/i386/compile/SPINNE i386

>Description:
	sometimes when executing a trap statement, the shell says:

		trap: Sigaction system call failed

	I suspect it is failing when a trap call such as this is tried:

		trap "" 1 2 3 4 5 6 7 8 9 10 12 13 14 15

>How-To-Repeat:

	in your .profile, execute the following

		trap '. $HOME/.shlogout ; exit $?' 0

	~/.shlogout contains:

----- cut here ----
#
#	.shlogout - logout script for ksh
#
#ident	"@(#)HOME:.shlogout	1.1	94/12/07 18:17:37 (web.net)"

trap "" 1 2 3 4 5 6 7 8 9 10 12 13 14 15
trap "" 0
echo ""
echo "| Logging $LOGNAME out of $UUNAME at `date`."
if expr `tty` : "/dev/tty[ab0]" >/dev/null; then
	sleep 2
	tput clear
fi
exit 0
----- end cut ----

	then logout and watch what happens....

>Fix:
	unknown
>Audit-Trail:
>Unformatted: