search for: pendingsigs

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

2019 Jan 25
0
[klibc:update-dash] trap: Globally rename pendingsigs to pending_sig
...ibc/klibc.git;a=commit;h=dbb7e738b59fe626fd25c4df9f348fecc434ce09 Author: Denys Vlasenko <dvlasenk at redhat.com> AuthorDate: Wed, 26 Oct 2016 19:28:29 +0200 Committer: Ben Hutchings <ben at decadent.org.uk> CommitDate: Fri, 25 Jan 2019 02:57:21 +0000 [klibc] trap: Globally rename pendingsigs to pending_sig This variable does not contain "sigs" (plural). It contains either 0 or (one) signal number of a pending signal. For someone unfamiliar with this code, "pendingsigs" name is confusing - it hints at being an array or bit mask of pending singnals. Signed-off-by:...
2020 Mar 28
0
[klibc:update-dash] dash: trap: Globally rename pendingsigs to pending_sig
...ibc.git;a=commit;h=e0829af46211f7919afe8f49dd3145c0cbb45d87 Author: Denys Vlasenko <dvlasenk at redhat.com> AuthorDate: Wed, 26 Oct 2016 19:28:29 +0200 Committer: Ben Hutchings <ben at decadent.org.uk> CommitDate: Sat, 28 Mar 2020 21:42:54 +0000 [klibc] dash: trap: Globally rename pendingsigs to pending_sig [ dash commit 53dab360a1e0dddcfd83c6cbfc9f720f5e233550 ] This variable does not contain "sigs" (plural). It contains either 0 or (one) signal number of a pending signal. For someone unfamiliar with this code, "pendingsigs" name is confusing - it hints at being...
2019 Jan 25
0
[klibc:update-dash] [TRAP] Make sure evalskip is zero before running traps
...erintuitive, even though both bash and ksh exhibit a similar behaviour. This patch fixes it by skipping trap processing if evalskip is set on entry. It also adds a dotrap call to the top of evaltree to ensure that while continue; do continue; done has a chance of running traps. Finally the pendingsigs check is moved into dotrap for compactness. 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 | 6 ++++-- usr/dash/trap.c | 11 +++++++++-- 2 files changed, 13 insertions(+), 4 deletions(-) diff --gi...
2020 Mar 28
0
[klibc:update-dash] dash: [TRAP] Make sure evalskip is zero before running traps
...erintuitive, even though both bash and ksh exhibit a similar behaviour. This patch fixes it by skipping trap processing if evalskip is set on entry. It also adds a dotrap call to the top of evaltree to ensure that while continue; do continue; done has a chance of running traps. Finally the pendingsigs check is moved into dotrap for compactness. 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 | 6 ++++-- usr/dash/trap.c | 11 +++++++++-- 2 files changed, 13 insertions(+), 4 deletions(-) diff --gi...
2019 Jan 25
0
[klibc:update-dash] [BUILTIN] Exit without arguments in a trap should use status outside traps
...tus; + } + exraise(EXEXIT); /* NOTREACHED */ } diff --git a/usr/dash/trap.c b/usr/dash/trap.c index 3ff45318..7dd8342f 100644 --- a/usr/dash/trap.c +++ b/usr/dash/trap.c @@ -313,12 +313,17 @@ void dotrap(void) char *p; char *q; int i; - int savestatus; + int status, last_status; if (!pendingsigs) return; - savestatus = exitstatus; + status = savestatus; + last_status = status; + if (likely(status < 0)) { + status = exitstatus; + savestatus = status; + } pendingsigs = 0; barrier(); @@ -337,8 +342,10 @@ void dotrap(void) if (!p) continue; evalstring(p, 0); - exitst...
2020 Mar 28
0
[klibc:update-dash] dash: [BUILTIN] Exit without arguments in a trap should use status outside traps
...tus; + } + exraise(EXEXIT); /* NOTREACHED */ } diff --git a/usr/dash/trap.c b/usr/dash/trap.c index 3ff45318..7dd8342f 100644 --- a/usr/dash/trap.c +++ b/usr/dash/trap.c @@ -313,12 +313,17 @@ void dotrap(void) char *p; char *q; int i; - int savestatus; + int status, last_status; if (!pendingsigs) return; - savestatus = exitstatus; + status = savestatus; + last_status = status; + if (likely(status < 0)) { + status = exitstatus; + savestatus = status; + } pendingsigs = 0; barrier(); @@ -337,8 +342,10 @@ void dotrap(void) if (!p) continue; evalstring(p, 0); - exitst...
2019 Jan 25
0
[klibc:update-dash] trap: Implement POSIX.1-2008 trap reset behaviour
...s <ben at decadent.org.uk> --- usr/dash/trap.c | 25 ++++++++++++++++++------- 1 file changed, 18 insertions(+), 7 deletions(-) diff --git a/usr/dash/trap.c b/usr/dash/trap.c index a6997d4f..89ceff4f 100644 --- a/usr/dash/trap.c +++ b/usr/dash/trap.c @@ -78,6 +78,8 @@ volatile sig_atomic_t pendingsigs; /* received SIGCHLD */ int gotsigchld; +static int decode_signum(const char *); + #ifdef mkinit INCLUDE "trap.h" INIT { @@ -111,7 +113,7 @@ trapcmd(int argc, char **argv) } return 0; } - if (!ap[1]) + if (!ap[1] || decode_signum(*ap) >= 0) action = NULL; else ac...
2020 Mar 28
0
[klibc:update-dash] dash: trap: Implement POSIX.1-2008 trap reset behaviour
...s <ben at decadent.org.uk> --- usr/dash/trap.c | 25 ++++++++++++++++++------- 1 file changed, 18 insertions(+), 7 deletions(-) diff --git a/usr/dash/trap.c b/usr/dash/trap.c index a6997d4f..89ceff4f 100644 --- a/usr/dash/trap.c +++ b/usr/dash/trap.c @@ -78,6 +78,8 @@ volatile sig_atomic_t pendingsigs; /* received SIGCHLD */ int gotsigchld; +static int decode_signum(const char *); + #ifdef mkinit INCLUDE "trap.h" INIT { @@ -111,7 +113,7 @@ trapcmd(int argc, char **argv) } return 0; } - if (!ap[1]) + if (!ap[1] || decode_signum(*ap) >= 0) action = NULL; else ac...
2007 Aug 23
0
[git patch] klibc dash 0.5.4 update
...return skip; + evalskip &= mask; + return status; } diff --git a/usr/dash/trap.c b/usr/dash/trap.c index 51e1d56..dc27224 100644 --- a/usr/dash/trap.c +++ b/usr/dash/trap.c @@ -294,7 +294,6 @@ dotrap(void) char *q; int i; int savestatus; - int skip = 0; savestatus = exitstatus; pendingsigs = 0; @@ -308,13 +307,13 @@ dotrap(void) p = trap[i + 1]; if (!p) continue; - skip = evalstring(p, SKIPEVAL); + evalstring(p, SKIPEVAL); exitstatus = savestatus; - if (skip) - break; + if (evalskip) + return evalskip; } - return skip; + return 0; } commit db69f76ecdb95...