summaryrefslogtreecommitdiffstats
path: root/bin/sh/error.c
Commit message (Collapse)AuthorAgeFilesLines
* sh: Add a function to print warnings (with command name and newline).jilles2010-12-211-6/+22
| | | | | | This is like error() but without raising an exception. It is particularly useful as a replacement for the warnx macro in bltin/bltin.h.
* In the spirit of r90111, depend on c89 and remove the "STATIC" macroobrien2010-10-131-2/+2
| | | | and its usage.
* Consistently use "STATIC" for all functions in order to be able to setobrien2010-10-131-2/+2
| | | | | | breakpoints with in a debugger. And use naked "static" for variables. Noticed by: bde
* sh: Fix shadowing of sigset.jilles2010-08-131-3/+3
|
* sh: Fix some bugs with backquoted builtins:jilles2010-01-011-2/+2
| | | | | | | | | | | | - 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
* sh: Add some __dead2 to indicate functions that do not return.jilles2009-12-241-1/+1
|
* Fix various things about SIGINT handling:jilles2009-11-221-2/+13
| | | | | | | | | | | | | | | | | | * 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.
* Remove some white space at EOL.schweikh2006-02-041-1/+1
|
* Remove clause 3 from the UCB licenses.markm2004-04-061-4/+0
| | | | OK'ed by: imp, core
* Convert the remaining callers of errmsg() to use strerror(), and removetjr2002-09-291-88/+0
| | | | errmsg() and its table of error messages.
* s/filesystem/file system/ as discussed on -developerstrhodes2002-08-211-2/+2
|
* Remove broken and incomplete support for old releases of System V,tjr2002-07-191-3/+0
| | | | don't support system that implement getcwd(3) with a pipe to /bin/pwd.
* Consistently use FBSDIDobrien2002-06-301-2/+2
|
* Implement the -C (-o noclobber) option, which prevents existing regulartjr2002-05-191-0/+1
| | | | files from being overwritten by shell redirection.
* Consistancy check s/file system/filesystem/trhodes2002-05-161-2/+2
| | | | Reviewed by: brian
* o __P has been reovedimp2002-02-021-41/+6
| | | | | | | | | | | | | | | | | | 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) { ...
* Include missing header files which define functions for which gcc hasdd2001-06-241-0/+1
| | | | builtins (e.g., exit, strcmp).
* -Wnon-const-format sweep: make format strings const char *'s, addkris2001-04-171-5/+5
| | | | | | __printflike()/__printf0like() to function prototypes, as appropriate. Reviewed by: bde, -audit
* Include strerror(errno) in error messages after failed system calls.cracauer1999-11-291-0/+1
| | | | Fix a warning.
* $Id$ -> $FreeBSD$peter1999-08-271-1/+1
|
* Improve bookkeeping of in_waitcmd and style fixes.cracauer1998-08-251-7/+8
| | | | Submitted by: Bruce Evans
* Got two volatile sig_atomic_t and int mixed up. Spotted by Gary Palmer.cracauer1998-08-241-2/+2
|
* Do not exit on SIGINT in non-interactive shells, fixes PR 1206,cracauer1998-08-241-13/+28
| | | | | | | | | | | | | | | | | | | | | | | | | 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
|
* Nuke register keyword usage and #if -> #ifdef.steve1997-04-281-7/+7
| | | | Obtained from: NetBSD
* 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.
* Merge in NetBSD mods and -Wall cleaning.steve1996-12-141-22/+59
| | | | Obtained from: NetBSD, me
* Fix for PR#1287. This makes sh behave sensibly in case statements in thepeter1996-09-031-9/+1
| | | | | | | | | | | | | | 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)
* Merge of 4.4-Lite2 sh source, plus some gcc -Wall cleaning. This is apeter1996-09-011-46/+53
| | | | | | | | | | | | | | 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-2/+2
| | | | Reviewed by: phk
* Added $Id$dg1994-09-241-0/+2
|
* BSD 4.4 Lite bin Sourcesrgrimes1994-05-261-0/+249
OpenPOWER on IntegriCloud