NetBSD/bin/sh
christos e6ab6d48dc PR/16174: Matthias Buelow: Job control fails on jobs that fd == 2 does not
point to a tty.

Unfortunately the shell assumed that it could do all process group
handling ioctls to fd=2, but this is not correct. Jobs that redirected
fd=2 would be unable to perform the ioctls and silently fail since
the error reporting channel is fd=2... Instead open /dev/tty set
it to close on exec, and use that instead (like all other shells
do). We don't handle the case where the OS does not provide FD_CLOEXEC
or FIOCLEX, because I am lazy.

While I am there:
- Simplify the code by defining functions for tc{g,s}pgrp when OLD_TTY_DRIVER
  is defined.
- make sure that 'sh &' works by stopping itself. Don't kill the shell's
  process group, kill the shell itself.
2002-04-03 14:30:44 +00:00
..
bltin Generate <>& symbolically. I'm avoiding .../dist/... directories for now. 2002-02-08 01:21:55 +00:00
funcs
Makefile back this directory up a day, systems won't even boot (rc.subr splodes) 2002-02-12 06:39:10 +00:00
TOUR
alias.c
alias.h
arith.y remove redundant declaration of yyparse, and move code to the bottom of 2001-02-04 19:51:43 +00:00
arith_lex.l
builtins.def
cd.c Plug a memory leak when setting PWD -- don't mark the variable with 2001-11-14 18:04:36 +00:00
cd.h
error.c include <stdlib.h>, <string.h>, or whatever as appropriate to shut up 2000-07-03 03:26:17 +00:00
error.h remove redundant declarations and nexted externs. 2001-02-04 19:52:06 +00:00
eval.c PR/11542: Back-out previous change that caused 2002-02-14 21:51:41 +00:00
eval.h
exec.c remove redundant declarations and nexted externs. 2001-02-04 19:52:06 +00:00
exec.h Back out previous vfork changes. 2000-05-22 10:18:46 +00:00
expand.c make sure we do not truncate arith expresssion > 10 digits. 2001-09-19 06:38:19 +00:00
expand.h
histedit.c get rid of sp completely, we were free-ing a bogus pointer; found by simonb. 2002-03-12 00:14:31 +00:00
init.h
input.c remove redundant declarations and nexted externs. 2001-02-04 19:52:06 +00:00
input.h Back out previous vfork changes. 2000-05-22 10:18:46 +00:00
jobs.c PR/16174: Matthias Buelow: Job control fails on jobs that fd == 2 does not 2002-04-03 14:30:44 +00:00
jobs.h Back out previous vfork changes. 2000-05-22 10:18:46 +00:00
machdep.h
mail.c include <stdlib.h>, <string.h>, or whatever as appropriate to shut up 2000-07-03 03:26:17 +00:00
mail.h
main.c Fix various misspellings of compatible/compatibility. 2001-06-11 01:50:48 +00:00
main.h
memalloc.c PR/11283: Hubert Feyrer: random memory corruption executing commands: 2000-11-01 19:56:01 +00:00
memalloc.h PR/11283: Hubert Feyrer: random memory corruption executing commands: 2000-11-01 19:56:01 +00:00
miscbltin.c remove redundant declarations and nexted externs. 2001-02-04 19:52:06 +00:00
miscbltin.h
mkbuiltins
mkinit.c host program portability: don't use <sys/cdefs.h>, __COPYRIGHT(), 2000-07-18 19:13:20 +00:00
mknodes.c host program portability: set infp to stdin at runtime, since apparently 2000-07-27 04:06:49 +00:00
mksyntax.c Since we should be able to handle nested double quotes, don't use 2002-02-12 20:32:35 +00:00
mktokens
myhistedit.h
mystring.c
mystring.h
nodes.c.pat
nodetypes
options.c Fix command name in error message for 'sh nonexistingfile'. 2001-02-26 13:06:43 +00:00
options.h remove redundant declarations and nexted externs. 2001-02-04 19:52:06 +00:00
output.c va_{start,end} audit: 2001-09-24 13:22:25 +00:00
output.h
parser.c enami convinced me that it is a good idea to use the first word of 2002-02-20 21:42:35 +00:00
parser.h un-__P functions declared in parser.h. host programs include parser.h, 2000-07-27 04:09:27 +00:00
redir.c Back out previous vfork changes. 2000-05-22 10:18:46 +00:00
redir.h Back out previous vfork changes. 2000-05-22 10:18:46 +00:00
sh.1 first variable argument to "read" is not optional 2002-02-24 21:41:52 +00:00
shell.h Back out previous vfork changes. 2000-05-22 10:18:46 +00:00
show.c back this directory up a day, systems won't even boot (rc.subr splodes) 2002-02-12 06:39:10 +00:00
show.h
trap.c Extended functionality of the trap builtin, which now closely follows 2001-03-18 04:04:23 +00:00
trap.h Back out previous vfork changes. 2000-05-22 10:18:46 +00:00
var.c remove redundant declarations and nexted externs. 2001-02-04 19:52:06 +00:00
var.h Back out previous vfork changes. 2000-05-22 10:18:46 +00:00