summaryrefslogtreecommitdiffstats
path: root/bin/sh/trap.c
Commit message (Collapse)AuthorAgeFilesLines
* $Id$ -> $FreeBSD$peter1999-08-271-1/+1
|
* Various spelling/formatting changes.kris1999-05-081-2/+2
| | | | Submitted by: Philippe Charnier <charnier@xp11.frmug.org>
* The immediate execution of traps I introduced in September 1998 (tocracauer1999-04-011-2/+3
| | | | | | | | | | make /etc/rc interruptible in cases when programs hang with blocked signals) isn't standard enough. It is now switched off by default and a new switch -T enables it. You should update /etc/rc to the version I'm about to commit in a few minutes to keep it interruptible.
* Narrow down conditions to break wait() to process traps.cracauer1998-09-101-3/+4
| | | | Improve comments.
* Fix an inefficiency I introduced in my last commit.cracauer1998-09-101-9/+4
| | | | Include "expand.h" vom memalloc.c to pull function declartion into scope
* If traps are set, they are now executed even when a signal-blockingcracauer1998-09-081-5/+18
| | | | | | | | | | | | foreground child is running. Formerly, traps were exceuted after the next child exit. The enables the user to put a breaking wrapper around a blocking application: (trap 'echo trap ; exit 1' 2; ./pestyblocker; echo -n) The "echo -n" after the child call is needed to prevent sh from optimizing the trap-executing shell away. I'm working on this.
* Improve bookkeeping of in_waitcmd and style fixes.cracauer1998-08-251-2/+2
| | | | Submitted by: Bruce Evans
* Re-enable killing childs with SIGQUIT. Spotted by Bruce Evans.cracauer1998-08-251-2/+2
|
* Do not exit on SIGINT in non-interactive shells, fixes PR 1206,cracauer1998-08-241-10/+18
| | | | | | | | | | | | | | | | | | | | | | | | | i.e. this makes emacs usable from system(3). Programs called from shellscripts are now required to exit with proper signal status. That means, they have to kill themself. Exiting with faked numerical exit code is not sufficient. Exit with proper signal status if script exits on signal. Make the wait builtin interruptable, both with and without traps set. Use volatile sig_atomic_t where (and only where) appropriate. (Almost) fix printing of newlines on SIGINT. Make traps setable from trap handlers. This is needed for shellscripts that catch SIGINT for cleanup work but intend to exit on it, hance have to kill themself from a trap handler. I.e. mkdep. While I'm at it, make it -Wall clean. -Wall is not enabled in Makefile, since vararg warnx() macro calls in usr.bin/printf/printf.c are not -Wall-able. PR: 1206 Obtained from: Basic SIGINT fix from Bruce Evans
* Add rcsid. Spelling.charnier1998-05-181-3/+5
|
* Fixed some type and value mismatches. setsignal() returned a boguslybde1997-11-101-10/+9
| | | | | | cast value that was always ignored. Rev.1.9 of trap.c made this more bogus by returning a semantically different value after calling siginterrupt(). Avoid these problems by not returning a value.
* 1) Fix longstanding bug:ache1997-11-051-3/+10
| | | | | | | | | | | | | | trap 'echo xxx' 1 2 3 15 read x is not interrupted by ^C (due to restartable read syscall) and must be interrupted per POSIX Worse case: read -t 5 x hangs forever after ^C pressed (supposed to timeout after 5 secs) Fixed by adding siginterrupt(signo, 1) after catch handler installed 2) Do not reinstall sighandler immediately after it is called, BSD do it for us
* Revert $FreeBSD$ to $Id$peter1997-02-221-1/+1
|
* Make the long-awaited change from $Id$ to $FreeBSD$jkh1997-01-141-1/+1
| | | | | | | | This will make a number of things easier in the future, as well as (finally!) avoiding the Id-smashing problem which has plagued developers for so long. Boy, I'm glad we're not using sup anymore. This update would have been insane otherwise.
* With these changes sh(1)'s trap command should be POSIX-compliant,steve1996-12-241-49/+107
| | | | | | | | | | | | | | | | | | | | | | | | | | while remaining (becoming :) compatible with other popular shells. Specifically these changes include: 1) Implement 'trap -l' to get a list of valid signals names. This is useful if you wanted to do something like reset all signal handlers to there defaults values, in which case something like this will do the trick. trap `trap -l` 2) Reformat the output of 'trap' so it can be saved and later eval'd to restore the saved settings. 3) Allow the use of signal names as well as signal numbers. 4) Fix trap handling of SIGCHLD so that commands like the following (albeit, contrived) won't cause sh(1) to recurse ad infinitum. trap uname 0 20 5) Make variables static that are used only in trap.c. 6) Minor 'style(9) police' mods.
* Merge in NetBSD mods and -Wall cleaning.steve1996-12-141-9/+9
| | | | Obtained from: NetBSD, me
* Merge of 4.4-Lite2 sh source, plus some gcc -Wall cleaning. This is apeter1996-09-011-29/+58
| | | | | | | | | | | | | | merge of parallel duplicate work by Steve Price and myself. :-] There are some changes to the build that are my fault... mkinit.c was trying (poorly) to duplicate some of the work that make(1) is designed to do. The Makefile hackery is my fault too, the depend list was incomplete because of some explicit OBJS+= entries, so mkdep wasn't picking up their source file #includes. This closes a pile of /bin/sh PR's, but not all of them.. Submitted by: Steve Price <steve@bonsai.hiwaay.net>, peter
* Remove trailing whitespace.rgrimes1995-05-301-5/+5
| | | | Reviewed by: phk
* Added $Id$dg1994-09-241-0/+2
|
* BSD 4.4 Lite bin Sourcesrgrimes1994-05-261-0/+348
OpenPOWER on IntegriCloud