diff options
author | Yann E. MORIN" <yann.morin.1998@anciens.enib.fr> | 2008-07-26 09:22:42 +0000 |
---|---|---|
committer | Yann E. MORIN" <yann.morin.1998@anciens.enib.fr> | 2008-07-26 09:22:42 +0000 |
commit | a586208ab4cdfcec9e18ef8bf14f81cefe9205f9 (patch) | |
tree | 008b814f4fea39deb499823ccd8debc7f7aad771 | |
parent | e64bc999d59fd6445f6ee9b093ab7b5e4847eea3 (diff) | |
download | crosstool-ng-a586208ab4cdfcec9e18ef8bf14f81cefe9205f9.tar.gz crosstool-ng-a586208ab4cdfcec9e18ef8bf14f81cefe9205f9.tar.bz2 crosstool-ng-a586208ab4cdfcec9e18ef8bf14f81cefe9205f9.zip |
In case of error, the error message would be printing in subshells, thus printing as many error message as there were subshells.
Limit printing this message only in the top-level shell.
/trunk/scripts/functions | 2 2 0 0 ++
1 file changed, 2 insertions(+)
-rw-r--r-- | scripts/functions | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/scripts/functions b/scripts/functions index e47b2862..c07c336c 100644 --- a/scripts/functions +++ b/scripts/functions @@ -5,6 +5,8 @@ # Prepare the fault handler CT_OnError() { ret=$? + # Bail out early in subshell, the upper level shell will act accordingly. + [ ${BASH_SUBSHELL} -eq 0 ] || exit $ret CT_DoLog ERROR "Build failed in step '${CT_STEP_MESSAGE[${CT_STEP_COUNT}]}'" for((step=(CT_STEP_COUNT-1); step>1; step--)); do CT_DoLog ERROR " called in step '${CT_STEP_MESSAGE[${step}]}'" |