aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGerrit Pape <pape@smarden.org>2010-06-28 17:11:58 +1000
committermaximilian attems <max@stro.at>2011-06-03 18:44:12 +0200
commitc2c398310975f491836eb01db26919f8ea7497e3 (patch)
tree82ea682289c906dd7fbb4bed45b85b91dabc23b2
parentbd5fc97084fe1e038f50e3da435d16936bc4d6db (diff)
downloadklibc-c2c398310975f491836eb01db26919f8ea7497e3.tar.gz
[klibc] [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 <pape@smarden.org> Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au> Signed-off-by: maximilian attems <max@stro.at>
-rw-r--r--usr/dash/eval.c1
1 files changed, 0 insertions, 1 deletions
diff --git a/usr/dash/eval.c b/usr/dash/eval.c
index 13c845a3337ef..f9aefa6544dae 100644
--- a/usr/dash/eval.c
+++ b/usr/dash/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 */
}