freebsd-dev/bin/sh
cracauer 8e91e03b52 Do not exit on SIGINT in non-interactive shells, fixes PR 1206,
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
1998-08-24 10:20:37 +00:00
..
bltin Nuke register keyword usage and #if -> #ifdef. 1997-04-28 03:06:52 +00:00
funcs Revert $FreeBSD$ to $Id$ 1997-02-22 14:13:04 +00:00
alias.c Add rcsid. Spelling. 1998-05-18 06:44:24 +00:00
alias.h Revert $FreeBSD$ to $Id$ 1997-02-22 14:13:04 +00:00
arith_lex.l Do not exit on SIGINT in non-interactive shells, fixes PR 1206, 1998-08-24 10:20:37 +00:00
arith.h Revert $FreeBSD$ to $Id$ 1997-02-22 14:13:04 +00:00
arith.y Do not exit on SIGINT in non-interactive shells, fixes PR 1206, 1998-08-24 10:20:37 +00:00
builtins.def Turn on the new type builtin. 1997-04-28 03:50:07 +00:00
cd.c Add rcsid. Spelling. 1998-05-18 06:44:24 +00:00
cd.h Added $Id$. 1997-12-29 00:00:10 +00:00
error.c Do not exit on SIGINT in non-interactive shells, fixes PR 1206, 1998-08-24 10:20:37 +00:00
error.h Do not exit on SIGINT in non-interactive shells, fixes PR 1206, 1998-08-24 10:20:37 +00:00
eval.c Add rcsid. Spelling. 1998-05-18 06:44:24 +00:00
eval.h Revert $FreeBSD$ to $Id$ 1997-02-22 14:13:04 +00:00
exec.c Add rcsid. Spelling. 1998-05-18 06:44:24 +00:00
exec.h Add a type builtin and nuke register keyword usage. 1997-04-28 03:08:38 +00:00
expand.c Add rcsid. Spelling. 1998-05-18 06:44:24 +00:00
expand.h Revert $FreeBSD$ to $Id$ 1997-02-22 14:13:04 +00:00
histedit.c Add rcsid. Spelling. 1998-05-18 06:44:24 +00:00
init.h Revert $FreeBSD$ to $Id$ 1997-02-22 14:13:04 +00:00
input.c Add rcsid. Spelling. 1998-05-18 06:44:24 +00:00
input.h Revert $FreeBSD$ to $Id$ 1997-02-22 14:13:04 +00:00
jobs.c Do not exit on SIGINT in non-interactive shells, fixes PR 1206, 1998-08-24 10:20:37 +00:00
jobs.h Do not exit on SIGINT in non-interactive shells, fixes PR 1206, 1998-08-24 10:20:37 +00:00
machdep.h Revert $FreeBSD$ to $Id$ 1997-02-22 14:13:04 +00:00
mail.c Add rcsid. Spelling. 1998-05-18 06:44:24 +00:00
mail.h Revert $FreeBSD$ to $Id$ 1997-02-22 14:13:04 +00:00
main.c Add rcsid. Spelling. 1998-05-18 06:44:24 +00:00
main.h Revert $FreeBSD$ to $Id$ 1997-02-22 14:13:04 +00:00
Makefile Added a `build-tools' target for internal tools. 1998-07-07 01:06:58 +00:00
memalloc.c Add rcsid. Spelling. 1998-05-18 06:44:24 +00:00
memalloc.h Revert $FreeBSD$ to $Id$ 1997-02-22 14:13:04 +00:00
miscbltin.c Do not exit on SIGINT in non-interactive shells, fixes PR 1206, 1998-08-24 10:20:37 +00:00
mkbuiltins Revert $FreeBSD$ to $Id$ 1997-02-22 14:13:04 +00:00
mkinit.c Add rcsid. Spelling. 1998-05-18 06:44:24 +00:00
mknodes.c Add rcsid. Spelling. 1998-05-18 06:44:24 +00:00
mksyntax.c Add rcsid. Spelling. 1998-05-18 06:44:24 +00:00
mktokens Revert $FreeBSD$ to $Id$ 1997-02-22 14:13:04 +00:00
myhistedit.h Revert $FreeBSD$ to $Id$ 1997-02-22 14:13:04 +00:00
mystring.c Add rcsid. Spelling. 1998-05-18 06:44:24 +00:00
mystring.h Revert $FreeBSD$ to $Id$ 1997-02-22 14:13:04 +00:00
nodes.c.pat Nuke register keyword usage, #if -> #ifdef, and avoid void * 1997-04-28 03:14:04 +00:00
nodetypes Revert $FreeBSD$ to $Id$ 1997-02-22 14:13:04 +00:00
options.c Add rcsid. Spelling. 1998-05-18 06:44:24 +00:00
options.h Revert $FreeBSD$ to $Id$ 1997-02-22 14:13:04 +00:00
output.c Add rcsid. Spelling. 1998-05-18 06:44:24 +00:00
output.h Nuke register keyword usage and #if -> #ifdef. 1997-04-28 03:06:52 +00:00
parser.c Add rcsid. Spelling. 1998-05-18 06:44:24 +00:00
parser.h Revert $FreeBSD$ to $Id$ 1997-02-22 14:13:04 +00:00
redir.c Add rcsid. Spelling. 1998-05-18 06:44:24 +00:00
redir.h Revert $FreeBSD$ to $Id$ 1997-02-22 14:13:04 +00:00
sh.1 Document behaviour of "-" and "--" on the command line. 1998-07-30 04:47:56 +00:00
shell.h Revert $FreeBSD$ to $Id$ 1997-02-22 14:13:04 +00:00
show.c Add rcsid. Spelling. 1998-05-18 06:44:24 +00:00
show.h Reorder declarations slightly. 1997-04-28 03:17:51 +00:00
TOUR Revert $FreeBSD$ to $Id$ 1997-02-22 14:13:04 +00:00
trap.c Do not exit on SIGINT in non-interactive shells, fixes PR 1206, 1998-08-24 10:20:37 +00:00
trap.h Do not exit on SIGINT in non-interactive shells, fixes PR 1206, 1998-08-24 10:20:37 +00:00
var.c Add rcsid. Spelling. 1998-05-18 06:44:24 +00:00
var.h Revert $FreeBSD$ to $Id$ 1997-02-22 14:13:04 +00:00