| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
|
|
|
|
|
| |
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
|
|
|
|
|
|
|
|
| |
If INTON re-enables interrupts, it processes any interrupt that occurred
while interrupts were disabled. Make SETINTON do the same.
Notes:
svn path=/head/; revision=319591
|
|
|
|
|
|
|
|
|
|
|
|
| |
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
|
|
|
|
|
|
|
|
| |
As a result, the INTON macro which is used many times generates fewer
bytes of code.
Notes:
svn path=/head/; revision=276038
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
If EV_EXIT causes an exit, use the exception mechanism to unwind
redirections and local variables. This way, if the final command is a
redirected command, an EXIT trap now executes without the redirections.
Because of these changes, EV_EXIT can now be inherited by the body of a
function, so do so. This means that a function no longer prevents a fork
before an exec being skipped, such as in
f() { head -1 /etc/passwd; }; echo $(f)
Wrapping a single builtin in a function may still cause an otherwise
unnecessary fork with command substitution, however.
An exit command or -e failure still invokes the EXIT trap with the
original redirections and local variables in place.
Note: this depends on SHELLPROC being gone. A SHELLPROC depended on
keeping the redirections and local variables and only cleaning up the
state to restore them.
Notes:
svn path=/head/; revision=220978
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
These are called "shell procedures" in the source.
If execve() failed with [ENOEXEC], the shell would reinitialize itself
and execute the program as a script. This requires a fair amount of code
which is not frequently used (most scripts have a #! magic number).
Therefore just execute a new instance of sh (_PATH_BSHELL) to run the
script.
Notes:
svn path=/head/; revision=218306
|
|
|
|
|
|
|
|
|
| |
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
|
|
|
|
| |
Notes:
svn path=/head/; revision=200967
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* 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
|
|
|
|
|
|
|
| |
OK'ed by: imp, core
Notes:
svn path=/head/; revision=127958
|
|
|
|
|
|
|
| |
errmsg() and its table of error messages.
Notes:
svn path=/head/; revision=104132
|
|
|
|
|
|
|
| |
don't support system that implement getcwd(3) with a pipe to /bin/pwd.
Notes:
svn path=/head/; revision=100351
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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
|
|
|
|
|
|
|
|
|
| |
__printflike()/__printf0like() to function prototypes, as appropriate.
Reviewed by: bde, -audit
Notes:
svn path=/head/; revision=75577
|
|
|
|
|
|
|
|
|
|
|
| |
spaces reserved by the header files it includes.
mkinit.c still produces C code with redundant declarations, although
they are more harmless since they automatically derived from the right
places.
Notes:
svn path=/head/; revision=59436
|
|
|
|
| |
Notes:
svn path=/head/; revision=50471
|
|
|
|
|
|
|
| |
Submitted by: Philippe Charnier <charnier@xp11.frmug.org>
Notes:
svn path=/head/; revision=46684
|
|
|
|
| |
Notes:
svn path=/head/; revision=38530
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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
|
|
|
|
| |
Notes:
svn path=/head/; revision=22988
|
|
|
|
|
|
|
|
|
|
|
| |
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
|
|
|
|
|
|
|
| |
Obtained from: NetBSD, me
Notes:
svn path=/head/; revision=20425
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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 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
|
|
|
|
| |
Notes:
svn path=/head/; revision=3044
|
|
Notes:
svn path=/head/; revision=1556
|