| Age | Commit message (Collapse) | Author |
|
Print a status message for a terminated child if: 1) the wait builtin is called
in an interactive shell, or 2) the child terminated due to a signal and it is
not sigint and not sigpipe or it caused the child to dump core.
The messages are of the form:
[pid:] <signal message[--core dumped] | done (status)>
Before this, there were various inconsistencies, e.g. the wait builtin--
regardless if called in an interactive shell or script--would print just the
pid and a colon w/o a message and w/o a newline if the child it waited for
terminated due to receiving sigint.
|
|
|
|
This fixes rakitzis/rc issue #40.
Both cases suffered from a misconception of statprint() in which the necessary
check for -e happens. The checked status value gets passed to statprint() as an
argument but the corresponding value passed to rc_exit() in case the status is
non-zero comes from getstatus(), which requires that the checked status is
written to statuses[] first. For pipelines this happened in the wrong order and
for backquotes the status value was not put into statuses[] at all.
Making statprint() a static helper function prevents this mistake by only
leaving the setstatus family of functions to handle status codes.
|
|
Portability: status.c assumes traditional Unix layout of 0 and 1 exit
statuses in the parent, which is not shared by BeOS. Add mkstatval.c.
|
|
|
|
also, always check that WTERMSIG is in range
|
|
|
|
|
|
|
|
|
|
|
|
|