mirror of
git://git.code.sf.net/p/cdesktopenv/code
synced 2025-03-09 15:50:02 +00:00
As I got to know the code better, it now seems painfully obvious that getting test/[ to issue an exit status >= 2 on error only requires a simple check in sh_exit() in fault.c, which is called whenever the shell issues an error message.
This commit is contained in:
parent
8ced1daadf
commit
74730c8ac7
5 changed files with 5 additions and 25 deletions
|
|
@ -513,7 +513,11 @@ void sh_exit(register int xno)
|
|||
register struct checkpt *pp = (struct checkpt*)shp->jmplist;
|
||||
register int sig=0;
|
||||
register Sfio_t* pool;
|
||||
shp->exitval=xno;
|
||||
/* POSIX requires exit status >= 2 for error in 'test'/'[' */
|
||||
if(xno == 1 && (shp->bltindata.bnode==SYSTEST || shp->bltindata.bnode==SYSBRACKET))
|
||||
shp->exitval = 2;
|
||||
else
|
||||
shp->exitval = xno;
|
||||
if(xno==SH_EXITSIG)
|
||||
shp->exitval |= (sig=shp->lastsig);
|
||||
if(pp && pp->mode>1)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue