search for: forceinton

Displaying 16 results from an estimated 16 matches for "forceinton".

2019 Jan 25
0
[klibc:update-dash] jobs - Do not block when waiting on SIGCHLD
...2e3e..56661880 100644 --- a/usr/dash/eval.c +++ b/usr/dash/eval.c @@ -859,10 +859,8 @@ bail: if (!(flags & EV_EXIT) || have_traps()) { INTOFF; jp = makejob(cmd, 1); - if (forkshell(jp, cmd, FORK_FG) != 0) { - INTON; + if (forkshell(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; -...
2020 Mar 28
0
[klibc:update-dash] dash: jobs - Do not block when waiting on SIGCHLD
...66e5..13e690e7 100644 --- a/usr/dash/eval.c +++ b/usr/dash/eval.c @@ -859,10 +859,8 @@ bail: if (!(flags & EV_EXIT) || have_traps()) { INTOFF; jp = makejob(cmd, 1); - if (forkshell(jp, cmd, FORK_FG) != 0) { - INTON; + if (forkshell(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; -...
2019 Jan 25
0
[klibc:update-dash] [ERROR] Set exitstatus in onint
...= 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] Do not clobber exitstatus in evalcommand
.../eval.c index 501d47fe..b384cb82 100644 --- a/usr/dash/eval.c +++ b/usr/dash/eval.c @@ -853,12 +853,9 @@ bail: listsetvar(varlist.list, VEXPORT); } if (evalbltin(cmdentry.u.cmd, argc, argv, flags)) { - if (exception == EXERROR) { - exitstatus = 2; - if (spclbltin <= 0) { - FORCEINTON; - break; - } + if (exception == EXERROR && spclbltin <= 0) { + FORCEINTON; + break; } raise: longjmp(handler->loc, 1);
2020 Mar 28
0
[klibc:update-dash] dash: [ERROR] Set exitstatus in onint
...= 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: [EVAL] Do not clobber exitstatus in evalcommand
.../eval.c index b3e971bf..3e08e825 100644 --- a/usr/dash/eval.c +++ b/usr/dash/eval.c @@ -853,12 +853,9 @@ bail: listsetvar(varlist.list, VEXPORT); } if (evalbltin(cmdentry.u.cmd, argc, argv, flags)) { - if (exception == EXERROR) { - exitstatus = 2; - if (spclbltin <= 0) { - FORCEINTON; - break; - } + if (exception == EXERROR && spclbltin <= 0) { + FORCEINTON; + break; } raise: longjmp(handler->loc, 1);
2012 Jul 02
0
[klibc:master] [EVAL] Remove unused EV_BACKCMD flag
...(n, EV_BACKCMD, result); - - ifsfirst = saveifs; - ifslastp = savelastp; - argbackq = saveargbackq; - } else -#endif - { - int pip[2]; - struct job *jp; - - if (pipe(pip) < 0) - sh_error("Pipe call failed"); - jp = makejob(n, 1); - if (forkshell(jp, n, FORK_NOJOB) == 0) { - FORCEINTON; - close(pip[0]); - if (pip[1] != 1) { - dup2(pip[1], 1); - close(pip[1]); - } - ifsfree(); - evaltreenr(n, EV_EXIT); - /* NOTREACHED */ + if (pipe(pip) < 0) + sh_error("Pipe call failed"); + jp = makejob(n, 1); + if (forkshell(jp, n, FORK_NOJOB) == 0) { + FORCEINTO...
2019 Jan 25
0
[klibc:update-dash] eval: Reap zombies after built-in commands and functions
...@@ 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 = exitstatus; break; } + status = waitforj...
2020 Mar 28
0
[klibc:update-dash] dash: eval: Reap zombies after built-in commands and functions
...@@ 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 = exitstatus; break; } + status = waitforj...
2020 Mar 28
0
[klibc:update-dash] dash: eval: Reset handler when entering a subshell
...pe.backgnd) == 0) { + reset_handler(); INTON; if (pip[1] >= 0) { close(pip[0]); @@ -630,6 +633,7 @@ evalbackcmd(union node *n, struct backcmd *result) sh_error("Pipe call failed"); jp = makejob(n, 1); if (forkshell(jp, n, FORK_NOJOB) == 0) { + reset_handler(); FORCEINTON; close(pip[0]); if (pip[1] != 1) { diff --git a/usr/dash/main.c b/usr/dash/main.c index 6b3a0909..b2712cbd 100644 --- a/usr/dash/main.c +++ b/usr/dash/main.c @@ -71,6 +71,7 @@ int *dash_errno; short profile_buf[16384]; extern int etext(); #endif +static struct jmploc main_handler; STATI...
2020 Mar 28
0
[klibc:update-dash] dash: eval: Replace with listsetvar with mklocal/setvareq
...; BUILTIN_REGULAR)) { - find_command(argv[0], &cmdentry, cmd_flag | DO_ERR, - unlikely(path) ? path : pathval()); + path = unlikely(path) ? path : pathval(); + find_command(argv[0], &cmdentry, cmd_flag | DO_ERR, path); } jp = NULL; @@ -881,17 +897,10 @@ bail: break; FORCEINTON; } - listsetvar(varlist.list, VEXPORT|VSTACK); - path = unlikely(path) ? path : pathval(); shellexec(argv, path, cmdentry.u.index); /* NOTREACHED */ case CMDBUILTIN: - if (spclbltin > 0 || argc == 0) { - poplocalvars(1); - if (execcmd && argc > 1) - listsetvar(v...
2020 Mar 28
0
[klibc:update-dash] dash: eval: Add vfork support
...l.c index 77a8bded..7bb636e1 100644 --- a/usr/dash/eval.c +++ b/usr/dash/eval.c @@ -892,10 +892,8 @@ bail: /* Fork off a child process if necessary. */ if (!(flags & EV_EXIT) || have_traps()) { INTOFF; - jp = makejob(cmd, 1); - if (forkshell(jp, cmd, FORK_FG) != 0) - break; - FORCEINTON; + jp = vforkexec(cmd, argv, path, cmdentry.u.index); + break; } shellexec(argv, path, cmdentry.u.index); /* NOTREACHED */ diff --git a/usr/dash/exec.h b/usr/dash/exec.h index 2b318257..423b07e6 100644 --- a/usr/dash/exec.h +++ b/usr/dash/exec.h @@ -58,6 +58,8 @@ struct cmdentry { #de...
2020 Mar 28
0
[klibc:update-dash] dash: eval: Add assignment built-in support again
...XECCMD) - execcmd++; - if (cmdentry.u.cmd != COMMANDCMD) - break; - - path = oldpath; - nargv = parse_command_args(argv, &path); - if (!nargv) - break; - argc -= nargv - argv; - argv = nargv; - cmd_flag |= DO_NOFUNC; + goto bail; } } @@ -864,6 +882,7 @@ bail: FORCEINTON; } listsetvar(varlist.list, VEXPORT|VSTACK); + path = unlikely(path) ? path : pathval(); shellexec(argv, path, cmdentry.u.index); /* NOTREACHED */ diff --git a/usr/dash/exec.c b/usr/dash/exec.c index 6c0a64f6..9d0215a6 100644 --- a/usr/dash/exec.c +++ b/usr/dash/exec.c @@ -357,11 +35...
2019 Jan 25
0
[klibc:update-dash] eval: Return status in eval functions
...job(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 = exitstatus; break; } @@ -894,6 +903,8 @@...
2020 Mar 28
0
[klibc:update-dash] dash: eval: Return status in eval functions
...job(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 = exitstatus; break; } @@ -894,6 +903,8 @@...
2007 Aug 23
0
[git patch] klibc dash 0.5.4 update
...Xu <herbert at gondor.apana.org.au> Signed-off-by: maximilian attems <max at stro.at> diff --git a/usr/dash/eval.c b/usr/dash/eval.c index 23b9608..a9a73db 100644 --- a/usr/dash/eval.c +++ b/usr/dash/eval.c @@ -625,8 +625,7 @@ evalbackcmd(union node *n, struct backcmd *result) FORCEINTON; close(pip[0]); if (pip[1] != 1) { - close(1); - copyfd(pip[1], 1); + dup2(pip[1], 1); close(pip[1]); } eflag = 0; commit 42813b34771be5ed6b806aafe75dfe3f58d0c2e2 Author: Herbert Xu <herbert at gondor.apana.org.au> Date: Sun May 6 12:01:37 2007 +1000 Remo...