search for: backcmd

Displaying 9 results from an estimated 9 matches for "backcmd".

Did you mean: ack_cmd
2019 Jan 25
0
[klibc:update-dash] eval: Return status in eval functions
...evalfor(union node *, int); +STATIC int evalcase(union node *, int); +STATIC int evalsubshell(union node *, int); STATIC void expredir(union node *); -STATIC void evalpipe(union node *, int); +STATIC int evalpipe(union node *, int); #ifdef notyet -STATIC void evalcommand(union node *, int, struct backcmd *); +STATIC int evalcommand(union node *, int, struct backcmd *); #else -STATIC void evalcommand(union node *, int); +STATIC int evalcommand(union node *, int); #endif STATIC int evalbltin(const struct builtincmd *, int, char **, int); STATIC int evalfun(struct funcnode *, int, char **, int); @...
2020 Mar 28
0
[klibc:update-dash] dash: eval: Return status in eval functions
...evalfor(union node *, int); +STATIC int evalcase(union node *, int); +STATIC int evalsubshell(union node *, int); STATIC void expredir(union node *); -STATIC void evalpipe(union node *, int); +STATIC int evalpipe(union node *, int); #ifdef notyet -STATIC void evalcommand(union node *, int, struct backcmd *); +STATIC int evalcommand(union node *, int, struct backcmd *); #else -STATIC void evalcommand(union node *, int); +STATIC int evalcommand(union node *, int); #endif STATIC int evalbltin(const struct builtincmd *, int, char **, int); STATIC int evalfun(struct funcnode *, int, char **, int); @...
2012 Jul 02
0
[klibc:master] [EVAL] Remove unused EV_BACKCMD flag
...s/klibc/klibc.git;a=commit;h=4467d6e5caa5c97023c824114cf76c7d862340e5 Author: Jonathan Nieder <jrnieder at gmail.com> AuthorDate: Thu, 7 Jul 2011 11:55:42 +0800 Committer: maximilian attems <max at stro.at> CommitDate: Mon, 2 Jul 2012 10:38:03 +0200 [klibc] [EVAL] Remove unused EV_BACKCMD flag The original ash defered forking commands in backquotes so builtins could be run in the same context as the shell. This behavior was controlled using the EV_BACKCMD to evaltree. Unfortunately, as Matthias Scheler noticed in 1999 (NetBSD PR/7814), the result was counterintuitive; for example...
2020 Mar 28
0
[klibc:update-dash] dash: eval: Reset handler when entering a subshell
...irect, 0); evaltreenr(n->nredir.n, flags); /* never returns */ @@ -574,6 +576,7 @@ evalpipe(union node *n, int flags) } } if (forkshell(jp, lp->n, n->npipe.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 10064...
2019 Jan 25
0
[klibc:update-dash] [BUILTIN] Exit without arguments in a trap should use status outside traps
.../eval.h @@ -37,6 +37,7 @@ extern char *commandname; /* currently executing command */ extern int exitstatus; /* exit status of last command */ extern int back_exitstatus; /* exit status of backquoted command */ +extern int savestatus; /* exit status of last command outside traps */ struct backcmd { /* result of evalbackcmd */ diff --git a/usr/dash/main.c b/usr/dash/main.c index f79ad7dd..29a258d3 100644 --- a/usr/dash/main.c +++ b/usr/dash/main.c @@ -339,8 +339,15 @@ exitcmd(int argc, char **argv) { if (stoppedjobs()) return 0; - if (argc > 1) - exitstatus = number(argv[1]); + +...
2020 Mar 28
0
[klibc:update-dash] dash: [BUILTIN] Exit without arguments in a trap should use status outside traps
.../eval.h @@ -37,6 +37,7 @@ extern char *commandname; /* currently executing command */ extern int exitstatus; /* exit status of last command */ extern int back_exitstatus; /* exit status of backquoted command */ +extern int savestatus; /* exit status of last command outside traps */ struct backcmd { /* result of evalbackcmd */ diff --git a/usr/dash/main.c b/usr/dash/main.c index f79ad7dd..29a258d3 100644 --- a/usr/dash/main.c +++ b/usr/dash/main.c @@ -339,8 +339,15 @@ exitcmd(int argc, char **argv) { if (stoppedjobs()) return 0; - if (argc > 1) - exitstatus = number(argv[1]); + +...
2019 Jan 25
0
[klibc:update-dash] [SHELL] Optimize dash -c "command" to avoid a fork
...evaltree(n, flags); + evaltree(n, flags & ~(parser_eof() ? 0 : EV_EXIT)); status = exitstatus; popstackmark(&smark); if (evalskip) diff --git a/usr/dash/eval.h b/usr/dash/eval.h index 5ccfa9f1..dc8acd2a 100644 --- a/usr/dash/eval.h +++ b/usr/dash/eval.h @@ -46,6 +46,10 @@ struct backcmd { /* result of evalbackcmd */ struct job *jp; /* job structure for command */ }; +/* flags in argument to evaltree */ +#define EV_EXIT 01 /* exit after evaluating tree */ +#define EV_TESTED 02 /* exit status is checked; ignore -e flag */ + int evalstring(char *, int); union node; /* BLET...
2020 Mar 28
0
[klibc:update-dash] dash: [SHELL] Optimize dash -c "command" to avoid a fork
...evaltree(n, flags); + evaltree(n, flags & ~(parser_eof() ? 0 : EV_EXIT)); status = exitstatus; popstackmark(&smark); if (evalskip) diff --git a/usr/dash/eval.h b/usr/dash/eval.h index 5ccfa9f1..dc8acd2a 100644 --- a/usr/dash/eval.h +++ b/usr/dash/eval.h @@ -46,6 +46,10 @@ struct backcmd { /* result of evalbackcmd */ struct job *jp; /* job structure for command */ }; +/* flags in argument to evaltree */ +#define EV_EXIT 01 /* exit after evaluating tree */ +#define EV_TESTED 02 /* exit status is checked; ignore -e flag */ + int evalstring(char *, int); union node; /* BLET...
2007 Aug 23
0
[git patch] klibc dash 0.5.4 update
...Make eval with empty arguments return 0 Fixed inverted char class matching Fixed command -v segmentation fault Fix mkbuiltin sort order Fix typo in comment Remove unnecessary inclusion of redir.h Remove EMFILE special case Use dup2 instead of copyfd in evalbackcmd Replace copyfd by savefd and use dup2 elsewhere Remove redundant CLOEXEC calls Fix redirect restore on saved file descriptors Size optimisations in redir.c Release 0.5.4. maximilian attems (1): README.klibc: dash update to latest HEAD with the following diffsta...