search for: exerror

Displaying 14 results from an estimated 14 matches for "exerror".

Did you mean: ecerror
2019 Jan 25
0
[klibc:update-dash] [EVAL] Do not clobber exitstatus in evalcommand
...0ab734a4d2976d37 Author: Herbert Xu <herbert at gondor.apana.org.au> AuthorDate: Fri, 3 Oct 2014 14:07:07 +0800 Committer: Ben Hutchings <ben at decadent.org.uk> CommitDate: Fri, 25 Jan 2019 02:57:21 +0000 [klibc] [EVAL] Do not clobber exitstatus in evalcommand All originators of EXERROR have been setting the exitstatus for a while now. So it is no longer appropriate to set it explicitly in evalcommand. In fact doing so may cause the original exitstatus to be lost. Signed-off-by: Herbert Xu <herbert at gondor.apana.org.au> Signed-off-by: Ben Hutchings <ben at decadent.o...
2020 Mar 28
0
[klibc:update-dash] dash: [EVAL] Do not clobber exitstatus in evalcommand
...ana.org.au> AuthorDate: Fri, 3 Oct 2014 14:07:07 +0800 Committer: Ben Hutchings <ben at decadent.org.uk> CommitDate: Sat, 28 Mar 2020 21:42:54 +0000 [klibc] dash: [EVAL] Do not clobber exitstatus in evalcommand [ dash commit 0d1fb088a4a16569260de4266d4bd359491c6bcd ] All originators of EXERROR have been setting the exitstatus for a while now. So it is no longer appropriate to set it explicitly in evalcommand. In fact doing so may cause the original exitstatus to be lost. Signed-off-by: Herbert Xu <herbert at gondor.apana.org.au> Signed-off-by: Ben Hutchings <ben at decadent.o...
2020 Mar 28
0
[klibc:update-dash] dash: eval: Only restore exit status on exit/return
....c | 5 ++++- 5 files changed, 13 insertions(+), 8 deletions(-) diff --git a/usr/dash/error.h b/usr/dash/error.h index f91d11d1..8df0134f 100644 --- a/usr/dash/error.h +++ b/usr/dash/error.h @@ -69,7 +69,8 @@ extern int exception; /* exceptions */ #define EXINT 0 /* SIGINT received */ #define EXERROR 1 /* a generic error */ -#define EXEXIT 4 /* exit the shell */ +#define EXEND 3 /* exit the shell */ +#define EXEXIT 4 /* exit the shell via exitcmd */ /* diff --git a/usr/dash/eval.c b/usr/dash/eval.c index bba0e7f8..1aad31a0 100644 --- a/usr/dash/eval.c +++ b/usr/dash/eval.c @@ -114,12 +114...
2020 Mar 28
0
[klibc:update-dash] dash: eval: Fail immediately with redirections errors for simple command
...+818,17 @@ evalcommand(union node *cmd, int flags) redir_stop = pushredir(cmd->ncmd.redirect); status = redirectsafe(cmd->ncmd.redirect, REDIR_PUSH|REDIR_SAVEFD2); + if (status) { +bail: + exitstatus = status; + + /* We have a redirection error. */ + if (spclbltin > 0) + exraise(EXERROR); + + goto out; + } + for (argp = cmd->ncmd.assign; argp; argp = argp->narg.next) { struct strlist **spp; @@ -848,30 +859,19 @@ evalcommand(union node *cmd, int flags) !(cmdentry.u.cmd->flags & BUILTIN_REGULAR)) { find_command(argv[0], &cmdentry, cmd_flag | DO_ERR,...
2019 Jan 25
0
[klibc:update-dash] jobs - Do not block when waiting on SIGCHLD
...ell(jp, cmd, FORK_FG) != 0) break; - } FORCEINTON; } listsetvar(varlist.list, VEXPORT|VSTACK); @@ -875,11 +873,8 @@ bail: if (execcmd && argc > 1) listsetvar(varlist.list, VEXPORT); } - if (evalbltin(cmdentry.u.cmd, argc, argv, flags)) { - if (exception == EXERROR && spclbltin <= 0) { - FORCEINTON; - break; - } + if (evalbltin(cmdentry.u.cmd, argc, argv, flags) && + !(exception == EXERROR && spclbltin <= 0)) { raise: longjmp(handler->loc, 1); } @@ -892,6 +887,7 @@ raise: } status = waitforjob(jp);...
2020 Mar 28
0
[klibc:update-dash] dash: jobs - Do not block when waiting on SIGCHLD
...ell(jp, cmd, FORK_FG) != 0) break; - } FORCEINTON; } listsetvar(varlist.list, VEXPORT|VSTACK); @@ -875,11 +873,8 @@ bail: if (execcmd && argc > 1) listsetvar(varlist.list, VEXPORT); } - if (evalbltin(cmdentry.u.cmd, argc, argv, flags)) { - if (exception == EXERROR && spclbltin <= 0) { - FORCEINTON; - break; - } + if (evalbltin(cmdentry.u.cmd, argc, argv, flags) && + !(exception == EXERROR && spclbltin <= 0)) { raise: longjmp(handler->loc, 1); } @@ -892,6 +887,7 @@ raise: } status = waitforjob(jp);...
2019 Jan 25
0
[klibc:update-dash] [ERROR] Set exitstatus in onint
...ntry.u.cmd, argc, argv, flags)) { - int status; - int i; - - i = exception; - if (i == EXEXIT) - goto raise; - - status = (i == EXINT) ? SIGINT + 128 : 2; - exitstatus = status; - - if (i == EXINT || spclbltin > 0) { -raise: - longjmp(handler->loc, 1); + if (exception == EXERROR) { + exitstatus = 2; + if (spclbltin <= 0) { + FORCEINTON; + break; + } } - FORCEINTON; +raise: + longjmp(handler->loc, 1); } break;
2020 Mar 28
0
[klibc:update-dash] dash: [ERROR] Set exitstatus in onint
...ntry.u.cmd, argc, argv, flags)) { - int status; - int i; - - i = exception; - if (i == EXEXIT) - goto raise; - - status = (i == EXINT) ? SIGINT + 128 : 2; - exitstatus = status; - - if (i == EXINT || spclbltin > 0) { -raise: - longjmp(handler->loc, 1); + if (exception == EXERROR) { + exitstatus = 2; + if (spclbltin <= 0) { + FORCEINTON; + break; + } } - FORCEINTON; +raise: + longjmp(handler->loc, 1); } break;
2019 Jan 25
0
[klibc:update-dash] eval: Reap zombies after built-in commands and functions
...entry.cmdtype) { default: @@ -856,7 +858,6 @@ bail: INTOFF; jp = makejob(cmd, 1); if (forkshell(jp, cmd, FORK_FG) != 0) { - status = waitforjob(jp); INTON; break; } @@ -875,22 +876,22 @@ bail: if (evalbltin(cmdentry.u.cmd, argc, argv, flags)) { if (exception == EXERROR && spclbltin <= 0) { FORCEINTON; - goto readstatus; + break; } raise: longjmp(handler->loc, 1); } - goto readstatus; + break; case CMDFUNCTION: poplocalvars(1); if (evalfun(cmdentry.u.func, argc, argv, flags)) goto raise; -readstatus: - status =...
2020 Mar 28
0
[klibc:update-dash] dash: eval: Reap zombies after built-in commands and functions
...entry.cmdtype) { default: @@ -856,7 +858,6 @@ bail: INTOFF; jp = makejob(cmd, 1); if (forkshell(jp, cmd, FORK_FG) != 0) { - status = waitforjob(jp); INTON; break; } @@ -875,22 +876,22 @@ bail: if (evalbltin(cmdentry.u.cmd, argc, argv, flags)) { if (exception == EXERROR && spclbltin <= 0) { FORCEINTON; - goto readstatus; + break; } raise: longjmp(handler->loc, 1); } - goto readstatus; + break; case CMDFUNCTION: poplocalvars(1); if (evalfun(cmdentry.u.func, argc, argv, flags)) goto raise; -readstatus: - status =...
2011 Jun 14
0
klibc 1.5.23 release
...leak [klibc] [BUILTIN] Fix trailing field bug in read(1) [klibc] [BUILTIN] Fix EXEXEC status clobbering [klibc] [EXPAND] Fix ifsfirst/ifslastp leak in casematch [klibc] [EVAL] Fixed trap/return regression due to SKIPEVAL removal [klibc] [ERROR] Allow the originator of EXERROR to set the exit status [klibc] [EXPAND] Free IFS state in evalbackcmd [klibc] [BUILTIN] Fix CTLESC clobbering by read(1) [klibc] [BUILTIN] Fix backslash handling in read(1) [klibc] [PARSER] Fix clobbering of checkkwd Jilles Tjoelker (5): [klibc] [EVAL] Force fork...
2020 Mar 28
0
[klibc:update-dash] dash: eval: Replace with listsetvar with mklocal/setvareq
...v, path, cmdentry.u.index); /* NOTREACHED */ case CMDBUILTIN: - if (spclbltin > 0 || argc == 0) { - poplocalvars(1); - if (execcmd && argc > 1) - listsetvar(varlist.list, VEXPORT); - } if (evalbltin(cmdentry.u.cmd, argc, argv, flags) && !(exception == EXERROR && spclbltin <= 0)) { raise: @@ -913,7 +922,8 @@ out: popredir(execcmd); unwindredir(redir_stop); unwindfiles(file_stop); - unwindlocalvars(localvar_stop); + if (likely(vlocal)) + unwindlocalvars(localvar_stop); if (lastarg) /* dsl: I think this is intended to be used to su...
2019 Jan 25
0
[klibc:update-dash] eval: Return status in eval functions
...9,7 +856,7 @@ bail: INTOFF; jp = makejob(cmd, 1); if (forkshell(jp, cmd, FORK_FG) != 0) { - exitstatus = waitforjob(jp); + status = waitforjob(jp); INTON; break; } @@ -868,17 +875,19 @@ bail: if (evalbltin(cmdentry.u.cmd, argc, argv, flags)) { if (exception == EXERROR && spclbltin <= 0) { FORCEINTON; - break; + goto readstatus; } raise: longjmp(handler->loc, 1); } - break; + goto readstatus; case CMDFUNCTION: poplocalvars(1); if (evalfun(cmdentry.u.func, argc, argv, flags)) goto raise; +readstatus: + status =...
2020 Mar 28
0
[klibc:update-dash] dash: eval: Return status in eval functions
...9,7 +856,7 @@ bail: INTOFF; jp = makejob(cmd, 1); if (forkshell(jp, cmd, FORK_FG) != 0) { - exitstatus = waitforjob(jp); + status = waitforjob(jp); INTON; break; } @@ -868,17 +875,19 @@ bail: if (evalbltin(cmdentry.u.cmd, argc, argv, flags)) { if (exception == EXERROR && spclbltin <= 0) { FORCEINTON; - break; + goto readstatus; } raise: longjmp(handler->loc, 1); } - break; + goto readstatus; case CMDFUNCTION: poplocalvars(1); if (evalfun(cmdentry.u.func, argc, argv, flags)) goto raise; +readstatus: + status =...