History log of /freebsd-9.3-release/bin/sh/error.c
Revision Date Author Comments
(<<< Hide modified files)
(Show modified files >>>)
# 267654 19-Jun-2014 gjb

Copy stable/9 to releng/9.3 as part of the 9.3-RELEASE cycle.

Approved by: re (implicit)
Sponsored by: The FreeBSD Foundation

# 225736 22-Sep-2011 kensmith

Copy head to stable/9 as part of 9.0-RELEASE release cycle.

Approved by: re (implicit)


# 216622 21-Dec-2010 jilles

sh: Add a function to print warnings (with command name and newline).
This is like error() but without raising an exception.
It is particularly useful as a replacement for the warnx macro in
bltin/bltin.h.


# 213811 13-Oct-2010 obrien

In the spirit of r90111, depend on c89 and remove the "STATIC" macro
and its usage.


# 213760 13-Oct-2010 obrien

Consistently use "STATIC" for all functions in order to be able to set
breakpoints with in a debugger. And use naked "static" for variables.

Noticed by: bde


# 211281 13-Aug-2010 jilles

sh: Fix shadowing of sigset.


# 201366 01-Jan-2010 jilles

sh: Fix some bugs with backquoted builtins:
- correctly handle error output in $(builtin 2>&1), clarify out1/out2 vs
output/errout in the code
- treat all builtins as regular builtins so errors do not abort the shell
and variable assignments do not persist
- respect the caller's INTOFF

Some bugs still exist:
- expansion errors may still abort the shell
- some side effects of expansions and builtins persist


# 200967 24-Dec-2009 jilles

sh: Add some __dead2 to indicate functions that do not return.


# 199660 22-Nov-2009 jilles

Fix various things about SIGINT handling:
* exception handlers are now run with interrupts disabled, which avoids
many race conditions
* fix some cases where SIGINT only aborts one command and continues the
script, in particular if a SIGINT causes an EINTR error which trumped the
interrupt.

Example:
sh -c 'echo < /some/fifo; echo This should not be printed'
The fifo should not have writers. When pressing ctrl+c to abort the open,
the shell used to continue with the next command.

Example:
sh -c '/bin/echo < /some/fifo; echo This should not be printed'
Similar. Note, however, that this particular case did not and does not work
in interactive mode with job control enabled.


# 155301 04-Feb-2006 schweikh

Remove some white space at EOL.


# 127958 06-Apr-2004 markm

Remove clause 3 from the UCB licenses.

OK'ed by: imp, core


# 104132 29-Sep-2002 tjr

Convert the remaining callers of errmsg() to use strerror(), and remove
errmsg() and its table of error messages.


# 102230 21-Aug-2002 trhodes

s/filesystem/file system/ as discussed on -developers


# 100351 19-Jul-2002 tjr

Remove broken and incomplete support for old releases of System V,
don't support system that implement getcwd(3) with a pipe to /bin/pwd.


# 99110 30-Jun-2002 obrien

Consistently use FBSDID


# 96922 19-May-2002 tjr

Implement the -C (-o noclobber) option, which prevents existing regular
files from being overwritten by shell redirection.


# 96702 15-May-2002 trhodes

Consistancy check s/file system/filesystem/

Reviewed by: brian


# 90111 02-Feb-2002 imp

o __P has been reoved
o Old-style K&R declarations have been converted to new C89 style
o register has been removed
o prototype for main() has been removed (gcc3 makes it an error)
o int main(int argc, char *argv[]) is the preferred main definition.
o Attempt to not break style(9) conformance for declarations more than
they already are.
o Change
int
foo() {
...
to
int
foo(void)
{
...


# 78732 24-Jun-2001 dd

Include missing header files which define functions for which gcc has
builtins (e.g., exit, strcmp).


# 75577 17-Apr-2001 kris

-Wnon-const-format sweep: make format strings const char *'s, add
__printflike()/__printf0like() to function prototypes, as appropriate.

Reviewed by: bde, -audit


# 53891 29-Nov-1999 cracauer

Include strerror(errno) in error messages after failed system calls.
Fix a warning.


# 50471 27-Aug-1999 peter

$Id$ -> $FreeBSD$


# 38536 25-Aug-1998 cracauer

Improve bookkeeping of in_waitcmd and style fixes.
Submitted by: Bruce Evans


# 38530 24-Aug-1998 cracauer

Got two volatile sig_atomic_t and int mixed up. Spotted by Gary Palmer.


# 38521 24-Aug-1998 cracauer

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


# 36150 18-May-1998 charnier

Add rcsid. Spelling.


# 25222 28-Apr-1997 steve

Nuke register keyword usage and #if -> #ifdef.

Obtained from: NetBSD


# 22988 22-Feb-1997 peter

Revert $FreeBSD$ to $Id$


# 21673 14-Jan-1997 jkh

Make the long-awaited change from $Id$ to $FreeBSD$

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.


# 20425 14-Dec-1996 steve

Merge in NetBSD mods and -Wall cleaning.

Obtained from: NetBSD, me


# 18018 03-Sep-1996 peter

Fix for PR#1287. This makes sh behave sensibly in case statements in the
face of aliases. Note, bash doesn't do aliases while running scripts, but
"real" ksh does..

Also:
Reduce redundant .Nm macros in (unused) bltin/echo.1
nuke error2, it's hardly used.
More -Wall cleanups
dont do certain history operations if NO_HISTORY defined
handle quad_t's from resource limits

Submitted by: Steve Price <sprice@hiwaay.net> (minor tweaks by me)


# 17987 01-Sep-1996 peter

Merge of 4.4-Lite2 sh source, plus some gcc -Wall cleaning. This is a
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


# 8855 29-May-1995 rgrimes

Remove trailing whitespace.

Reviewed by: phk


# 3044 24-Sep-1994 dg

Added $Id$


# 1557 26-May-1994 rgrimes

This commit was generated by cvs2svn to compensate for changes in r1556,
which included commits to RCS files with non-trunk default branches.


# 1556 26-May-1994 rgrimes

BSD 4.4 Lite bin Sources