From cdfb42fd67558847b689c69b6fdd23016e7220eb Mon Sep 17 00:00:00 2001 From: Gerrit Pape Date: Mon, 28 Jun 2010 17:11:58 +1000 Subject: [EVAL] Don't clear eflag in evalbackcmd According to http://www.opengroup.org/onlinepubs/009695399/utilities/xcu_chap02.html#tag_02_12 "A subshell environment shall be created as a duplicate of the shell environment, except that signal traps set by that shell environment shall be set to the default values." Currently the eflag is cleared when forking a subshell, e.g. $ dash -c 'set -e ; z=$(false;echo foo) ; echo $z' foo With this commit the eflag is preserved for subshells, and dash exits 1 before echo. The problem was reported by Vincent Lefevre through http://bugs.debian.org/514863 Signed-off-by: Gerrit Pape Signed-off-by: Herbert Xu --- ChangeLog | 4 ++++ src/eval.c | 1 - 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index 5a11a8c..e45405c 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,7 @@ +2010-06-28 Gerrit Pape + + * Don't clear eflag in evalbackcmd. + 2010-05-29 Herbert Xu * Continue after EINTR in read(1) with no pending signals. diff --git a/src/eval.c b/src/eval.c index 439f881..d142412 100644 --- a/src/eval.c +++ b/src/eval.c @@ -625,7 +625,6 @@ evalbackcmd(union node *n, struct backcmd *result) dup2(pip[1], 1); close(pip[1]); } - eflag = 0; evaltreenr(n, EV_EXIT); /* NOTREACHED */ } -- cgit 1.4.1