From 6295220ed3f49fe2c1795a0f033f7ef3ee604b52 Mon Sep 17 00:00:00 2001 From: Otto Moerbeek Date: Wed, 5 Sep 2007 19:02:02 +0000 Subject: Call ERR trap _before_ doing exit handling. Otherwise it's too late and the ERR trap won't get called at all. ok millert@ --- bin/ksh/exec.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'bin/ksh') 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; } -- cgit v1.2.3