search for: last_status

Displaying 8 results from an estimated 8 matches for "last_status".

Did you mean: ask_status
2006 Apr 16
3
[ win32utils-Patches-4121 ] Make it possible to read process exit status
...mary: Make it possible to read process exit status Initial Comment: The UNIX Open3 sets the global $? to a Process::Status object so that one can read the exit status of the sub process. It seems that one is not supposed to fiddle with /that/ variable, but we can make our own. This patch adds a #last_status method to both the Open3 and Open4 modules that returns a Process::Status object that is set when the pipes are closed (similarly to how Ruby does it in io.c). I also made popen3 and popen4 return the object when they''re called with a block. I figured it was as neat idea. --------------...
2019 Jan 25
0
[klibc:update-dash] [BUILTIN] Exit without arguments in a trap should use status outside traps
...) + savestatus = status; + } + 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; evals...
2020 Mar 28
0
[klibc:update-dash] dash: [BUILTIN] Exit without arguments in a trap should use status outside traps
...) + savestatus = status; + } + 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; evals...
2006 Jul 03
0
[ win32utils-Patches-4121 ] Make it possible to read process exit status
...mary: Make it possible to read process exit status Initial Comment: The UNIX Open3 sets the global $? to a Process::Status object so that one can read the exit status of the sub process. It seems that one is not supposed to fiddle with /that/ variable, but we can make our own. This patch adds a #last_status method to both the Open3 and Open4 modules that returns a Process::Status object that is set when the pipes are closed (similarly to how Ruby does it in io.c). I also made popen3 and popen4 return the object when they''re called with a block. I figured it was as neat idea. --------------...
2019 Jan 25
0
[klibc:update-dash] [BUILTIN] Return without arguments in a trap should use status outside traps
...-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
...-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;
2019 Jan 25
0
[klibc:update-dash] trap: Globally rename pendingsigs to pending_sig
...ing_sig; /* received SIGCHLD */ int gotsigchld; @@ -290,7 +290,7 @@ onsig(int 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 @@ vo...
2020 Mar 28
0
[klibc:update-dash] dash: trap: Globally rename pendingsigs to pending_sig
...ing_sig; /* received SIGCHLD */ int gotsigchld; @@ -290,7 +290,7 @@ onsig(int 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 @@ vo...