Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/bin/ksh PR/6764: Charles M. Hannum: `trap 0' does not work i...



details:   https://anonhg.NetBSD.org/src/rev/922107fc068f
branches:  trunk
changeset: 778425:922107fc068f
user:      christos <christos%NetBSD.org@localhost>
date:      Sun Mar 25 17:23:48 2012 +0000

description:
PR/6764: Charles M. Hannum: `trap 0' does not work in ksh subshells. When
subshells exit normally, use unwind(LEXIT) instead of unwind(LLEAVE) so that
traps get executed.

diffstat:

 bin/ksh/exec.c |  8 +++++---
 1 files changed, 5 insertions(+), 3 deletions(-)

diffs (39 lines):

diff -r 7e03b623b409 -r 922107fc068f bin/ksh/exec.c
--- a/bin/ksh/exec.c    Sun Mar 25 16:31:51 2012 +0000
+++ b/bin/ksh/exec.c    Sun Mar 25 17:23:48 2012 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: exec.c,v 1.14 2011/10/16 17:12:11 joerg Exp $  */
+/*     $NetBSD: exec.c,v 1.15 2012/03/25 17:23:48 christos Exp $       */
 
 /*
  * execute command tree
@@ -6,7 +6,7 @@
 #include <sys/cdefs.h>
 
 #ifndef lint
-__RCSID("$NetBSD: exec.c,v 1.14 2011/10/16 17:12:11 joerg Exp $");
+__RCSID("$NetBSD: exec.c,v 1.15 2012/03/25 17:23:48 christos Exp $");
 #endif
 
 
@@ -457,6 +457,7 @@
        int volatile flags;
 {
        int i;
+       int leave = LLEAVE;
        volatile int rv = 0;
        register char *cp;
        register char **lastp;
@@ -745,10 +746,11 @@
                rv = exchild(&texec, flags, -1);
                break;
        }
+       leave = LEXIT;
   Leave:
        if (flags & XEXEC) {
                exstat = rv;
-               unwind(LLEAVE);
+               unwind(leave);
        }
        return rv;
 }



Home | Main Index | Thread Index | Old Index