| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
|
|
|
|
|
| |
- Removed dead declarations
- Made objects that should have been declared as static, static.
The changes use STATIC instead of static, following the existing
convention in the rest of the code.
Approved by: schweikh (mentor)
MFC after: 2 weeks
|
|
|
|
|
|
|
| |
the child process writing data that the parent should have written.
PR: 50051
MFC after: 2 weeks
|
|
|
|
|
|
|
| |
it doesn't interfere with the user's redirections.
PR: 47136
MFC after: 1 week
|
|
|
|
|
|
|
|
| |
from the Makefile:
- Print pointers with %p instead of %x.
- Include missing headers to get prototypes.
Noticed by: benno
|
|
|
|
| |
status of a background process that has terminated because of a signal.
|
|
|
|
|
|
|
|
|
|
|
| |
pointers. This fixes two format warnings on 64 bits
archs which are fatal now that WFORMAT=0 has been removed.
It doesn't fully fix the sh(1) build on 64 bits platforms
though, there is still some quad_t issues that need to be
fixed.
Tested on: i386, sparc64
|
|
|
|
| |
no-op. I assume it was meant that the close-on-exec flag be set here.
|
|
|
|
| |
for consistency with ksh.
|
|
|
|
|
|
| |
forkshell() after it has been freed. This caused mysterious behaviour
when anything but the first command in a pipeline tried to access the
terminal when the `junk' malloc() option was enabled (which is the default).
|
|
|
|
|
|
| |
suspended. This is a followup to rev. 1.51.
MFC after: 1 week
|
|
|
|
| |
options.
|
|
|
|
| |
don't support system that implement getcwd(3) with a pipe to /bin/pwd.
|
|
|
|
|
|
| |
The pgrp member of struct job was declared as a short and could not store
every possible process group ID value, the rest of them were benign because
pid_t happens to be an int.
|
|
|
|
| |
by a signal the same as pdksh/bash/sh before rev. 1.34.
|
|
|
|
|
|
|
|
| |
2. Instead, open /dev/tty. This problem stopped commands in subshells from
being executed correctly if standard error was redirected.
PR: 36671
Obtained from: NetBSD (but simplified)
|
|
|
|
|
| |
many other parts of the shell are no longer compatible with this, and it
makes jobs.c quite cluttered with #ifdef's.
|
| |
|
|
|
|
| |
descriptors (">&-" or similar) correctly in the jobs(1) command.
|
| |
|
| |
|
| |
|
| |
|
|
|
|
| |
leaders in -l option to jobs(1).
|
| |
|
|
|
|
|
|
| |
%+ (current job, same as %%),
%- (previous job),
%?str (job with "str" in its command name).
|
|
|
|
| |
builtin. Modify the output format to match what SUSv3 requires.
|
|
|
|
| |
job control disabled.
|
|
|
|
|
| |
showjob(), use it inside dowait() to display status info for consistency,
and in a format closer to what the standard requires.
|
| |
|
|
|
|
|
|
| |
keep a linked list of the jobs, most recently used first. This is required
to support the idea of `previous job', and to allow the jobs fg and bg
default to be correct according to POSIX.
|
|
|
|
|
| |
fg outputs the name of the command, bg outputs the name of the command
and the job id.
|
|
|
|
| |
files from being overwritten by shell redirection.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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)
{
...
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
When a child is receiving SIGSTOP, eval continues with the next
command. While that is correct for the interactive case (Control-Z
and you get the prompt back), it is wrong for a shellscript, which
just continues with the next command, never again waiting for the
stopped child. Noted when childs from cronjobs were stopped, just to
make more processes (by wosch).
The fix is not to return from a job wait when the wait returned for a
stopped child while in non-interactive mode. This bahaviour seems to
be what bash2 and ksh implement. I tested for correct behaviour for
finnaly killing the child with and without forgrounding it first.
When not foregrouding before killing, the shell continues with the
script, which is what the other shells do as well.
Reviewed by: Silence on -current
|
|
|
|
| |
Use _PATH_* where where possible.
|
| |
|
|
|
|
|
|
|
|
| |
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.
|
|
|
|
| |
Fix a warning.
|
| |
|
|
|
|
| |
Submitted by: Philippe Charnier <charnier@xp11.frmug.org>
|
|
|
|
| |
PR: bin/9173
|
|
|
|
|
|
|
|
|
|
|
|
| |
foreground child is running. Formerly, traps were exceuted after the
next child exit.
The enables the user to put a breaking wrapper around a blocking
application:
(trap 'echo trap ; exit 1' 2; ./pestyblocker; echo -n)
The "echo -n" after the child call is needed to prevent sh from
optimizing the trap-executing shell away. I'm working on this.
|
|
|
|
| |
Submitted by: Bruce Evans
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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
|
| |
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
urgent need is when you run sh around a program that intentionally
uses SIGQUIT/SIGINT for asynchronous events, i.e. $EDITOR started from
system(2), like many mailers do. This fixes PR bin/1206 and possibly
bin/4241.
The solution committed has been tested for a large number of possible
cases (see recent discussion on cvs-committers). I completed a make
world, made sure 'make world' is interruptable and used the changed
/bin/sh as a login shell all day, including job control and using
SIGQUIT-catching programs (to write this message :-).
PR: bin/1206
Reviewed by: discussion on cvs-commiters
|
|
|
|
|
| |
Reorder includes to be alphabetical some places since I already was in
here.
|
|
|
|
| |
pid_t when referring to process IDs.
|
|
|
|
|
|
|
| |
using the WIF* macros in sys/wait.h.
PR: bin/3668
Submitted by: dholland@eecs.harvard.edu
|