summaryrefslogtreecommitdiff
path: root/bin/sh/error.c
Commit message (Collapse)AuthorAgeFilesLines
* sh: Unify EXERROR and EXEXECJilles Tjoelker2018-11-091-8/+11
| | | | | | | | | | | The difference between EXERROR and EXEXEC was that EXEXEC passed along exitstatus and EXERROR set exitstatus to 2 in the handling code. By changing the places that raised EXERROR to set exitstatus to 2, the handling of EXERROR and EXEXEC becomes the same. Notes: svn path=/head/; revision=340284
* Renumber copyright clause 4Warner Losh2017-02-281-1/+1
| | | | | | | | | | | | Renumber cluase 4 to 3, per what everybody else did when BSD granted them permission to remove clause 3. My insistance on keeping the same numbering for legal reasons is too pedantic, so give up on that point. Submitted by: Jan Schaumann <jschauma@stevens.edu> Pull Request: https://github.com/freebsd/freebsd/pull/96 Notes: svn path=/head/; revision=314436
* sh: Fix more compiler warnings related to variable declarations.Jilles Tjoelker2015-03-031-1/+1
| | | | Notes: svn path=/head/; revision=279569
* sh: Move some code from onint() to onsig(), making onint() noreturn.Jilles Tjoelker2014-12-211-17/+9
| | | | | | | | As a result, the INTON macro which is used many times generates fewer bytes of code. Notes: svn path=/head/; revision=276038
* sh: Prepend "$0: " to error messages if there is no command name.Jilles Tjoelker2014-11-221-0/+2
| | | | Notes: svn path=/head/; revision=274899
* sh: Add a function to print warnings (with command name and newline).Jilles Tjoelker2010-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. Notes: svn path=/head/; revision=216622
* In the spirit of r90111, depend on c89 and remove the "STATIC" macroDavid E. O'Brien2010-10-131-2/+2
| | | | | | | and its usage. Notes: svn path=/head/; revision=213811
* Consistently use "STATIC" for all functions in order to be able to setDavid E. O'Brien2010-10-131-2/+2
| | | | | | | | | breakpoints with in a debugger. And use naked "static" for variables. Noticed by: bde Notes: svn path=/head/; revision=213760
* sh: Fix shadowing of sigset.Jilles Tjoelker2010-08-131-3/+3
| | | | Notes: svn path=/head/; revision=211281
* sh: Fix some bugs with backquoted builtins:Jilles Tjoelker2010-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 Notes: svn path=/head/; revision=201366
* sh: Add some __dead2 to indicate functions that do not return.Jilles Tjoelker2009-12-241-1/+1
| | | | Notes: svn path=/head/; revision=200967
* Fix various things about SIGINT handling:Jilles Tjoelker2009-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. Notes: svn path=/head/; revision=199660
* Remove some white space at EOL.Jens Schweikhardt2006-02-041-1/+1
| | | | Notes: svn path=/head/; revision=155301
* Remove clause 3 from the UCB licenses.Mark Murray2004-04-061-4/+0
| | | | | | | OK'ed by: imp, core Notes: svn path=/head/; revision=127958
* Convert the remaining callers of errmsg() to use strerror(), and removeTim J. Robbins2002-09-291-88/+0
| | | | | | | errmsg() and its table of error messages. Notes: svn path=/head/; revision=104132
* s/filesystem/file system/ as discussed on -developersTom Rhodes2002-08-211-2/+2
| | | | Notes: svn path=/head/; revision=102230
* Remove broken and incomplete support for old releases of System V,Tim J. Robbins2002-07-191-3/+0
| | | | | | | don't support system that implement getcwd(3) with a pipe to /bin/pwd. Notes: svn path=/head/; revision=100351
* Consistently use FBSDIDDavid E. O'Brien2002-06-301-2/+2
| | | | Notes: svn path=/head/; revision=99110
* Implement the -C (-o noclobber) option, which prevents existing regularTim J. Robbins2002-05-191-0/+1
| | | | | | | files from being overwritten by shell redirection. Notes: svn path=/head/; revision=96922
* Consistancy check s/file system/filesystem/Tom Rhodes2002-05-161-2/+2
| | | | | | | Reviewed by: brian Notes: svn path=/head/; revision=96702
* o __P has been reovedWarner Losh2002-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) { ... Notes: svn path=/head/; revision=90111
* Include missing header files which define functions for which gcc hasDima Dorfman2001-06-241-0/+1
| | | | | | | builtins (e.g., exit, strcmp). Notes: svn path=/head/; revision=78732
* -Wnon-const-format sweep: make format strings const char *'s, addKris Kennaway2001-04-171-5/+5
| | | | | | | | | __printflike()/__printf0like() to function prototypes, as appropriate. Reviewed by: bde, -audit Notes: svn path=/head/; revision=75577
* Include strerror(errno) in error messages after failed system calls.Martin Cracauer1999-11-291-0/+1
| | | | | | | Fix a warning. Notes: svn path=/head/; revision=53891
* $Id$ -> $FreeBSD$Peter Wemm1999-08-271-1/+1
| | | | Notes: svn path=/head/; revision=50471
* Improve bookkeeping of in_waitcmd and style fixes.Martin Cracauer1998-08-251-7/+8
| | | | | | | Submitted by: Bruce Evans Notes: svn path=/head/; revision=38536
* Got two volatile sig_atomic_t and int mixed up. Spotted by Gary Palmer.Martin Cracauer1998-08-241-2/+2
| | | | Notes: svn path=/head/; revision=38530
* Do not exit on SIGINT in non-interactive shells, fixes PR 1206,Martin 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 Notes: svn path=/head/; revision=38521
* Add rcsid. Spelling.Philippe Charnier1998-05-181-3/+5
| | | | Notes: svn path=/head/; revision=36150
* Nuke register keyword usage and #if -> #ifdef.Steve Price1997-04-281-7/+7
| | | | | | | Obtained from: NetBSD Notes: svn path=/head/; revision=25222
* Revert $FreeBSD$ to $Id$Peter Wemm1997-02-221-1/+1
| | | | Notes: svn path=/head/; revision=22988
* Make the long-awaited change from $Id$ to $FreeBSD$Jordan K. Hubbard1997-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. Notes: svn path=/head/; revision=21673
* Merge in NetBSD mods and -Wall cleaning.Steve Price1996-12-141-22/+59
| | | | | | | Obtained from: NetBSD, me Notes: svn path=/head/; revision=20425
* Fix for PR#1287. This makes sh behave sensibly in case statements in thePeter Wemm1996-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) Notes: svn path=/head/; revision=18018
* Merge of 4.4-Lite2 sh source, plus some gcc -Wall cleaning. This is aPeter Wemm1996-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 Notes: svn path=/head/; revision=17987
* Remove trailing whitespace.Rodney W. Grimes1995-05-301-2/+2
| | | | | | | Reviewed by: phk Notes: svn path=/head/; revision=8855
* Added $Id$David Greenman1994-09-241-0/+2
| | | | Notes: svn path=/head/; revision=3044
* BSD 4.4 Lite bin SourcesRodney W. Grimes1994-05-261-0/+249
Notes: svn path=/head/; revision=1556