search for: checkexit

Displaying 12 results from an estimated 12 matches for "checkexit".

Did you mean: check_exit
2019 Jan 25
0
[klibc:update-dash] eval: Return status in eval functions
...altree(n, flags & ~(parser_eof() ? 0 : EV_EXIT)); if (n) - status = exitstatus; - popstackmark(&smark); + status = i; + if (evalskip) break; } @@ -192,13 +194,13 @@ evalstring(char *s, int flags) * exitstatus. */ -void +int evaltree(union node *n, int flags) { int checkexit = 0; - void (*evalfn)(union node *, int); + int (*evalfn)(union node *, int); unsigned isor; - int status; + int status = 0; if (n == NULL) { TRACE(("evaltree(NULL) called\n")); goto out; @@ -221,8 +223,7 @@ evaltree(union node *n, int flags) break; #endif case NNOT: - ev...
2020 Mar 28
0
[klibc:update-dash] dash: eval: Return status in eval functions
...altree(n, flags & ~(parser_eof() ? 0 : EV_EXIT)); if (n) - status = exitstatus; - popstackmark(&smark); + status = i; + if (evalskip) break; } @@ -192,13 +194,13 @@ evalstring(char *s, int flags) * exitstatus. */ -void +int evaltree(union node *n, int flags) { int checkexit = 0; - void (*evalfn)(union node *, int); + int (*evalfn)(union node *, int); unsigned isor; - int status; + int status = 0; if (n == NULL) { TRACE(("evaltree(NULL) called\n")); goto out; @@ -221,8 +223,7 @@ evaltree(union node *n, int flags) break; #endif case NNOT: - ev...
2020 Mar 28
0
[klibc:update-dash] dash: eval: make traps work when "set -e" is enabled
...echo "EXIT: $ret"' EXIT trap 'exit 2' HUP INT QUIT PIPE TERM read variable By pressing Ctrl-C one would expect the EXIT trap to be called, as it is the case with other shells (bash, zsh), but dash does not do it. By calling dotrap() before jumping to the exit path when checkexit is not zero, dash behaves like other shells. Signed-off-by: Antonio Ospite <ao2 at ao2.it> Signed-off-by: Herbert Xu <herbert at gondor.apana.org.au> Signed-off-by: Ben Hutchings <ben at decadent.org.uk> --- usr/dash/eval.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions...
2020 Jun 18
1
[PATCH] fix warnings with GCC 10
...| 2 +- usr/klibc/zlib/infback.c | 2 +- usr/klibc/zlib/inflate.c | 20 ++++++++++++++++++++ 3 files changed, 22 insertions(+), 2 deletions(-) diff --git a/usr/dash/eval.c b/usr/dash/eval.c index dd144948a9fa..6b2b01e19a47 100644 --- a/usr/dash/eval.c +++ b/usr/dash/eval.c @@ -274,7 +274,7 @@ checkexit: n->nbinary.ch1, (flags | ((isor >> 1) - 1)) & EV_TESTED ); - if (!exitstatus == isor) + if ((!exitstatus) == isor) break; if (!evalskip) { n = n->nbinary.ch2; diff --git a/usr/klibc/zlib/infback.c b/usr/klibc/zlib/infback.c index 455dbc9ee843..be5eace3ad1a 1...
2019 Jan 25
0
[klibc:update-dash] [TRAP] Make sure evalskip is zero before running traps
...--- a/usr/dash/eval.c +++ b/usr/dash/eval.c @@ -197,6 +197,9 @@ evaltree(union node *n, int flags) TRACE(("evaltree(NULL) called\n")); goto out; } + + dotrap(); + #ifndef SMALL displayhist = 1; /* show history substitutions done with fc */ #endif @@ -308,8 +311,7 @@ out: if (checkexit & exitstatus) goto exexit; - if (pendingsigs) - dotrap(); + dotrap(); if (flags & EV_EXIT) { exexit: diff --git a/usr/dash/trap.c b/usr/dash/trap.c index 182fa7ac..3ff45318 100644 --- a/usr/dash/trap.c +++ b/usr/dash/trap.c @@ -315,6 +315,9 @@ void dotrap(void) int i; int sav...
2019 Jan 25
0
[klibc:update-dash] [PATCH] eval: Silence compiler warning about missing parentheses
...or.apana.org.au> Signed-off-by: Ben Hutchings <ben at decadent.org.uk> --- usr/dash/eval.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/usr/dash/eval.c b/usr/dash/eval.c index 56661880..cecd41c1 100644 --- a/usr/dash/eval.c +++ b/usr/dash/eval.c @@ -278,7 +278,7 @@ checkexit: isor = n->type - NAND; status = evaltree(n->nbinary.ch1, (flags | ((isor >> 1) - 1)) & EV_TESTED); - if (!status == isor || evalskip) + if ((!status) == isor || evalskip) break; n = n->nbinary.ch2; evaln:
2020 Mar 28
0
[klibc:update-dash] dash: eval: Silence compiler warning about missing parentheses
...or.apana.org.au> Signed-off-by: Ben Hutchings <ben at decadent.org.uk> --- usr/dash/eval.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/usr/dash/eval.c b/usr/dash/eval.c index 09a5cbf1..dc0c9fa2 100644 --- a/usr/dash/eval.c +++ b/usr/dash/eval.c @@ -279,7 +279,7 @@ checkexit: isor = n->type - NAND; status = evaltree(n->nbinary.ch1, (flags | ((isor >> 1) - 1)) & EV_TESTED); - if (!status == isor || evalskip) + if ((!status) == isor || evalskip) break; n = n->nbinary.ch2; evaln:
2020 Mar 28
0
[klibc:update-dash] dash: [TRAP] Make sure evalskip is zero before running traps
...--- a/usr/dash/eval.c +++ b/usr/dash/eval.c @@ -197,6 +197,9 @@ evaltree(union node *n, int flags) TRACE(("evaltree(NULL) called\n")); goto out; } + + dotrap(); + #ifndef SMALL displayhist = 1; /* show history substitutions done with fc */ #endif @@ -308,8 +311,7 @@ out: if (checkexit & exitstatus) goto exexit; - if (pendingsigs) - dotrap(); + dotrap(); if (flags & EV_EXIT) { exexit: diff --git a/usr/dash/trap.c b/usr/dash/trap.c index 182fa7ac..3ff45318 100644 --- a/usr/dash/trap.c +++ b/usr/dash/trap.c @@ -315,6 +315,9 @@ void dotrap(void) int i; int sav...
2020 Mar 28
0
[klibc:update-dash] dash: eval: avoid leaking memory associated with redirections
...adent.org.uk> --- usr/dash/eval.c | 16 ++++++---------- 1 file changed, 6 insertions(+), 10 deletions(-) diff --git a/usr/dash/eval.c b/usr/dash/eval.c index 5074aa94..bba0e7f8 100644 --- a/usr/dash/eval.c +++ b/usr/dash/eval.c @@ -200,8 +200,12 @@ evaltree(union node *n, int flags) { int checkexit = 0; int (*evalfn)(union node *, int); + struct stackmark smark; unsigned isor; int status = 0; + + setstackmark(&smark); + if (n == NULL) { TRACE(("evaltree(NULL) called\n")); goto out; @@ -317,6 +321,8 @@ exexit: exraise(EXEXIT); } + popstackmark(&smark); +...
2020 Nov 09
4
[[PATCH v1 0/3] Fix clang build warnings
New clangs emit some warnings. The code isn't wrong, but should be updated to prevent warning creep. Bill Wendling (3): [klibc] dash: shell: Fix clang warnings [klibc] dash: shell: Fix clang warnings about format string [klibc] Kbuild: use an enum to silence a clang warning usr/dash/eval.c | 6 +++--- usr/dash/jobs.c | 2 +- usr/kinit/nfsmount/dummypmap.c
2020 Mar 27
2
[PATCH v2 5/5] Clean up clang warnings
...h/eval.c index ae83508ba160..2fa1a59995da 100644 --- a/usr/dash/eval.c +++ b/usr/dash/eval.c @@ -103,8 +103,8 @@ STATIC int bltincmd(int, char **); STATIC const struct builtincmd bltin = { - name: nullstr, - builtin: bltincmd + .name = nullstr, + .builtin = bltincmd }; @@ -274,7 +274,7 @@ checkexit: n->nbinary.ch1, (flags | ((isor >> 1) - 1)) & EV_TESTED ); - if (!exitstatus == isor) + if ((!exitstatus) == isor) break; if (!evalskip) { n = n->nbinary.ch2; @@ -1081,7 +1081,7 @@ eprintlist(struct output *out, struct strlist *sp, int sep) while (sp) {...
2020 Mar 27
12
[PATCH 0/5] Clang compatibility patches
This is a series of patches for clang compatibility: - Using flags needed flags and removing unsupported flags. - Adding support for clang's LLD linker. - Removing a variety of warnings. Bill Wendling (3): [klibc] Kbuild: use "libc.a" with clang [klibc] Kbuild: Add "-fcommon" for clang builds [klibc] Clean up clang warnings Michael Davidson (1): [klibc] Kbuild: