summaryrefslogtreecommitdiff
path: root/bin/ksh
diff options
context:
space:
mode:
authorOtto Moerbeek <otto@cvs.openbsd.org>2007-09-05 19:02:02 +0000
committerOtto Moerbeek <otto@cvs.openbsd.org>2007-09-05 19:02:02 +0000
commit6295220ed3f49fe2c1795a0f033f7ef3ee604b52 (patch)
treeab22f627fde8d9f1bb2d4ddc23f0ee9bca045ad3 /bin/ksh
parent6e15f4875d7959db4cfba88cc93f4281981356f2 (diff)
Call ERR trap _before_ doing exit handling. Otherwise it's too late
and the ERR trap won't get called at all. ok millert@
Diffstat (limited to 'bin/ksh')
-rw-r--r--bin/ksh/exec.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/bin/ksh/exec.c b/bin/ksh/exec.c
index 4d3500c3260..1eb65c02989 100644
--- a/bin/ksh/exec.c
+++ b/bin/ksh/exec.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: exec.c,v 1.47 2007/08/02 10:52:10 fgsch Exp $ */
+/* $OpenBSD: exec.c,v 1.48 2007/09/05 19:02:01 otto Exp $ */
/*
* execute command tree
@@ -363,9 +363,9 @@ execute(struct op *volatile t,
if ((flags&XEXEC))
unwind(LEXIT); /* exit child */
if (rv != 0 && !(flags & XERROK)) {
+ trapsig(SIGERR_);
if (Flag(FERREXIT))
unwind(LERROR);
- trapsig(SIGERR_);
}
return rv;
}