summary refs log tree commit diff
path: root/src/trap.c (follow)
Commit message (Collapse)AuthorAge
* [SHELL] Move flushall to the point just before _exitHerbert Xu2007-09-22
| | | | | | We need to flush at the very end in case we've generated any errors before that. The flushall call cannot perform a longjmp so it's safe there.
* [SHELL] Restore foreground process group on exitHerbert Xu2007-09-22
| | | | | | | | | | | | | | | | | On Thu, Jun 07, 2007 at 12:20:27PM +0200, Denis Vlasenko wrote: > > When I start dash under Midnight Commander and then type 'exit', dash > exits all right, but then MC is sent to background. It happens because > dash does not restore current process group on exit. > > Attached patch fixes this. It also fixes another bug: setjobctl(0) > must ignore tcsetpgrp errors, because there are cases when tty is > destroyed under dash. > > Patch is run-tested. I've fixed this slightly differently so that we don't need the xtcsetpgrp change.
* [EVAL] Make eval with empty arguments return 0 Herbert Xu2006-01-12
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | On Tue, Jan 10, 2006 at 10:56:23AM +0000, Gerrit Pape wrote: > tags 347232 + patch > quit > > On Mon, Jan 09, 2006 at 04:29:19PM +0100, Marco Nenciarini wrote: > > The problem is here: > > > > # Set the kernel 2.6 option only for fresh install > > test -z "$(GetMenuOpt "kopt" "")" && kopt_2_6="root=$root_device_2_6 ro" > > > > # Extract options for specific kernels > > eval $(ExtractMenuOpts "\(kopt_[a-zA-Z0-9_]\+\)") > > > > If the first test fails and the eval argument is empty then dash > > terminate with exitcode 1. > > > This is a simple testcase: > > tm:~# bash -c "set -e ;/bin/false && : ; eval ''; echo 'END'"; echo $? > > END > > 0 > > tm:~# dash -c "set -e ;/bin/false && : ; eval ''; echo 'END'"; echo $? > > 1 > > > > if you insert any command with successfull exit status before the > > empty eval, all work ok: > > tm:~# bash -c "set -e ;/bin/false && : ; : ; eval ''; echo 'END'"; echo $? > > END > > 0 > > tm:~# dash -c "set -e ;/bin/false && : ; : ; eval ''; echo 'END'"; echo $? > > END > > 0 > > Yes, I can confirm this is a bug in dash. The standard says > > EXIT STATUS > > If there are no arguments, or only null arguments, eval shall > return a zero exit status; otherwise, it shall return the exit > status of the command defined by the string of concatenated > arguments separated by <space>s. > > Hi Herbert, please see http://bugs.debian.org/347232 Changed evalstring to return the exit status instead of evalskip. This allows us to return zero if the string is empty.
* Copyright/licence updates and remove all traces of sys/cdefs.hHerbert Xu2005-10-29
| | | | | | | | | | | This change updates the BSD licence to the three-clause version since NetBSD has already done so. This makes dash GPL-compatible. It also adds Christos Zoulas (NetBSD ash maintainer) to the COPYING file. I've added "copyright by Herbert Xu" to most files. Finally all CVS IDs and inclusion of sys/cdefs.h have been removed. The latter is needed for support of klibc.
* Added eflag fixes for trap and minusc.herbert2005-09-26
| | | | | | Let evaltree handle traps from cmdloop. Reset evalskip after minusc is executed. Stop executing traps once SKIPEVAL is seen.
* Renamed error to sh_error.herbert2005-09-26
|
* Only reread exitstatus on EXEXIT in exitshell.herbert2005-09-26
|
* Initial import.Herbert Xu2005-09-26