Displaying 18 results from an estimated 18 matches for "savestatus".
Did you mean:
save_status
2019 Jan 25
0
[klibc:update-dash] [BUILTIN] Exit without arguments in a trap should use status outside traps
...ccd5e0c0 100644
--- a/usr/dash/eval.c
+++ b/usr/dash/eval.c
@@ -74,6 +74,7 @@ static int funcline; /* starting line number of current function, or 0 if not i
char *commandname;
int exitstatus; /* exit status of last command */
int back_exitstatus; /* exit status of backquoted command */
+int savestatus = -1; /* exit status of last command outside traps */
#if !defined(__alpha__) || (defined(__GNUC__) && __GNUC__ >= 3)
@@ -114,6 +115,10 @@ INCLUDE "eval.h"
RESET {
evalskip = 0;
loopnest = 0;
+ if (savestatus >= 0) {
+ exitstatus = savestatus;
+ savestatus = -1;...
[klibc:update-dash] dash: [BUILTIN] Exit without arguments in a trap should use status outside traps
2020 Mar 28
0
[klibc:update-dash] dash: [BUILTIN] Exit without arguments in a trap should use status outside traps
...1c76d4c5 100644
--- a/usr/dash/eval.c
+++ b/usr/dash/eval.c
@@ -74,6 +74,7 @@ static int funcline; /* starting line number of current function, or 0 if not i
char *commandname;
int exitstatus; /* exit status of last command */
int back_exitstatus; /* exit status of backquoted command */
+int savestatus = -1; /* exit status of last command outside traps */
#if !defined(__alpha__) || (defined(__GNUC__) && __GNUC__ >= 3)
@@ -114,6 +115,10 @@ INCLUDE "eval.h"
RESET {
evalskip = 0;
loopnest = 0;
+ if (savestatus >= 0) {
+ exitstatus = savestatus;
+ savestatus = -1;...
2020 Mar 28
0
[klibc:update-dash] dash: main: Only set savestatus in exitcmd
.../klibc.git;a=commit;h=bb0a62dfa61fec6497f1409c3cdfe8ceec94f1fa
Author: Herbert Xu <herbert at gondor.apana.org.au>
AuthorDate: Sat, 19 May 2018 02:39:38 +0800
Committer: Ben Hutchings <ben at decadent.org.uk>
CommitDate: Sat, 28 Mar 2020 21:42:55 +0000
[klibc] dash: main: Only set savestatus in exitcmd
[ dash commit d17dacd0f0499a8c77d810e211e8ff96b8898c48 ]
Currently exitcmd sets exitstatus and then savestatus if the latter
was previously set. In fact, as exitcmd always raises an exception
and will either end up in the setjmp call in main() or exitshell(),
where exitstatus is alway...
2020 Mar 28
0
[klibc:update-dash] dash: eval: Only restore exit status on exit/return
...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,13 @@ STATIC const struct builtincmd bltin = {
INCLUDE "eval.h"
EXITRESET {
- evalskip = 0;
- loopnest = 0;
if (savestatus >= 0) {
- exitstatus = savestatus;
+ if (exception == EXEXIT || evalskip == SKIPFUNCDEF)
+ exitstatus = savestatus;
savestatus = -1;
}
+ evalskip = 0;
+ loopnest = 0;
}
#endif
@@ -318,7 +319,7 @@ out:
if (flags & EV_EXIT) {
exexit:
- exraise(EXEXIT);
+ exraise(EXEND);
}...
2006 May 09
2
exten statement execution order
...${ARG1}=Extension ${ARG2}=Device(s) to ring
exten => s,1,NoOp(stdexten ${EXTEN})
exten => s,n,Set(cname=${CALLERID(number)}@asterisk.deskoptional.com)
exten => s,n,Set(CALLERID(number)=${cname})
exten => s,n,Macro(psa-predial)
exten => s,n,Dial(${ARG2},20,tTwW)
exten => s,n,Set(savestatus=${DIALSTATUS})
exten => s,n,Macro(psa-postdial)
exten =>
s,n,Goto(s-${savestatus},1);ANSWER,BUSY,CHANUNAVAIL,CONGESTION,ANSWER
exten => s-ANSWER,1,NoOp(call was answered!!!!!)
exten => s-CHANUNAVAIL,1,VoiceMail(u${ARG1})
exten => s-CONGESTION,1,VoiceMail(u${ARG1})
exten => s-NOAN...
2019 Jan 25
0
[klibc:update-dash] [TRAP] Make sure evalskip is zero before running traps
...xit & 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 savestatus;
+ if (!pendingsigs)
+ return;
+
savestatus = exitstatus;
pendingsigs = 0;
barrier();
@@ -322,6 +325,12 @@ void dotrap(void)
for (i = 0, q = gotsig; i < NSIG - 1; i++, q++) {
if (!*q)
continue;
+
+ if (evalskip) {
+ pendingsigs = i + 1;
+ break;
+ }
+
*q = 0;
p =...
2020 Mar 28
0
[klibc:update-dash] dash: [TRAP] Make sure evalskip is zero before running traps
...xit & 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 savestatus;
+ if (!pendingsigs)
+ return;
+
savestatus = exitstatus;
pendingsigs = 0;
barrier();
@@ -322,6 +325,12 @@ void dotrap(void)
for (i = 0, q = gotsig; i < NSIG - 1; i++, q++) {
if (!*q)
continue;
+
+ if (evalskip) {
+ pendingsigs = i + 1;
+ break;
+ }
+
*q = 0;
p =...
2006 Mar 09
3
problem with find()
I''m trying to update records in a table based on data I get back from a form.
In the simplest case, the params structure returned from the form is:
{"illness"=>{"1"=>{"illness_date"=>"", "qualifier"=>""}}}
The controller code works (i.e., updates the first record) when I do the following:
params[:illness].each do
2019 Jan 25
0
[klibc:update-dash] trap: Globally rename pendingsigs to pending_sig
...nt signo)
}
gotsig[signo - 1] = 1;
- pendingsigs = signo;
+ pending_sig = signo;
if (signo == SIGINT && !trap[SIGINT]) {
if (!suppressint)
@@ -313,7 +313,7 @@ void dotrap(void)
int i;
int status, last_status;
- if (!pendingsigs)
+ if (!pending_sig)
return;
status = savestatus;
@@ -322,7 +322,7 @@ void dotrap(void)
status = exitstatus;
savestatus = status;
}
- pendingsigs = 0;
+ pending_sig = 0;
barrier();
for (i = 0, q = gotsig; i < NSIG - 1; i++, q++) {
@@ -330,7 +330,7 @@ void dotrap(void)
continue;
if (evalskip) {
- pendingsigs = i + 1;
+...
2020 Mar 28
0
[klibc:update-dash] dash: trap: Globally rename pendingsigs to pending_sig
...nt signo)
}
gotsig[signo - 1] = 1;
- pendingsigs = signo;
+ pending_sig = signo;
if (signo == SIGINT && !trap[SIGINT]) {
if (!suppressint)
@@ -313,7 +313,7 @@ void dotrap(void)
int i;
int status, last_status;
- if (!pendingsigs)
+ if (!pending_sig)
return;
status = savestatus;
@@ -322,7 +322,7 @@ void dotrap(void)
status = exitstatus;
savestatus = status;
}
- pendingsigs = 0;
+ pending_sig = 0;
barrier();
for (i = 0, q = gotsig; i < NSIG - 1; i++, q++) {
@@ -330,7 +330,7 @@ void dotrap(void)
continue;
if (evalskip) {
- pendingsigs = i + 1;
+...
2019 Jan 25
0
[klibc:update-dash] input: Remove HETIO
..."hetio.h"
-#endif
-
/*
* Sigmode records the current value of the signal handlers for the various
* modes. A value of zero means that the current handler is not known.
@@ -381,9 +377,6 @@ exitshell(void)
struct jmploc loc;
char *p;
-#ifdef HETIO
- hetio_reset_term();
-#endif
savestatus = exitstatus;
TRACE(("pid %d, exitshell(%d)\n", getpid(), savestatus));
if (setjmp(loc.loc))
2020 Mar 28
0
[klibc:update-dash] dash: input: Remove HETIO
..."hetio.h"
-#endif
-
/*
* Sigmode records the current value of the signal handlers for the various
* modes. A value of zero means that the current handler is not known.
@@ -381,9 +377,6 @@ exitshell(void)
struct jmploc loc;
char *p;
-#ifdef HETIO
- hetio_reset_term();
-#endif
savestatus = exitstatus;
TRACE(("pid %d, exitshell(%d)\n", getpid(), savestatus));
if (setjmp(loc.loc))
2019 Jan 25
0
[klibc:update-dash] [BUILTIN] Return without arguments in a trap should use status outside traps
...}
}
diff --git a/usr/dash/trap.c b/usr/dash/trap.c
index 7dd8342f..b8470437 100644
--- a/usr/dash/trap.c
+++ b/usr/dash/trap.c
@@ -342,7 +342,8 @@ void dotrap(void)
if (!p)
continue;
evalstring(p, 0);
- exitstatus = status;
+ if (evalskip != SKIPFUNC)
+ exitstatus = status;
}
savestatus = last_status;
2020 Mar 28
0
[klibc:update-dash] dash: [BUILTIN] Return without arguments in a trap should use status outside traps
...}
}
diff --git a/usr/dash/trap.c b/usr/dash/trap.c
index 7dd8342f..b8470437 100644
--- a/usr/dash/trap.c
+++ b/usr/dash/trap.c
@@ -342,7 +342,8 @@ void dotrap(void)
if (!p)
continue;
evalstring(p, 0);
- exitstatus = status;
+ if (evalskip != SKIPFUNC)
+ exitstatus = status;
}
savestatus = last_status;
2020 Mar 28
0
[klibc:update-dash] dash: mkinit: Split reset into exitreset and reset
...etions(-)
diff --git a/usr/dash/eval.c b/usr/dash/eval.c
index 13e690e7..ff27ba9c 100644
--- a/usr/dash/eval.c
+++ b/usr/dash/eval.c
@@ -112,7 +112,7 @@ STATIC const struct builtincmd bltin = {
#ifdef mkinit
INCLUDE "eval.h"
-RESET {
+EXITRESET {
evalskip = 0;
loopnest = 0;
if (savestatus >= 0) {
diff --git a/usr/dash/expand.c b/usr/dash/expand.c
index 59a202cb..6ea0562f 100644
--- a/usr/dash/expand.c
+++ b/usr/dash/expand.c
@@ -1780,7 +1780,7 @@ varunset(const char *end, const char *var, const char *umsg, int varflags)
INCLUDE "expand.h"
-RESET {
+EXITRESET {
if...
2007 Aug 23
0
[git patch] klibc dash 0.5.4 update
...}
popfile();
- skip &= mask;
- evalskip = skip;
- 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;...
2019 Jan 25
0
[klibc:update-dash] eval: Return status in eval functions
...++++++++++++++++++++--------------------------
usr/dash/eval.h | 2 +-
usr/dash/main.c | 6 ++-
3 files changed, 80 insertions(+), 67 deletions(-)
diff --git a/usr/dash/eval.c b/usr/dash/eval.c
index ef6ec0ef..6ba64b12 100644
--- a/usr/dash/eval.c
+++ b/usr/dash/eval.c
@@ -81,16 +81,16 @@ int savestatus = -1; /* exit status of last command outside traps */
STATIC
#endif
void evaltreenr(union node *, int) __attribute__ ((__noreturn__));
-STATIC void evalloop(union node *, int);
-STATIC void evalfor(union node *, int);
-STATIC void evalcase(union node *, int);
-STATIC void evalsubshell(union nod...
2020 Mar 28
0
[klibc:update-dash] dash: eval: Return status in eval functions
...++++++++++++++++++++--------------------------
usr/dash/eval.h | 2 +-
usr/dash/main.c | 6 ++-
3 files changed, 80 insertions(+), 67 deletions(-)
diff --git a/usr/dash/eval.c b/usr/dash/eval.c
index 0380d1d2..a679ba31 100644
--- a/usr/dash/eval.c
+++ b/usr/dash/eval.c
@@ -81,16 +81,16 @@ int savestatus = -1; /* exit status of last command outside traps */
STATIC
#endif
void evaltreenr(union node *, int) __attribute__ ((__noreturn__));
-STATIC void evalloop(union node *, int);
-STATIC void evalfor(union node *, int);
-STATIC void evalcase(union node *, int);
-STATIC void evalsubshell(union nod...