From 2a74987925294a850998e0f62f259a6865b46da9 Mon Sep 17 00:00:00 2001 From: Thomas Schmitt Date: Sun, 17 Jul 2011 14:37:54 +0000 Subject: [PATCH] Using a more elegant way to obtain pipe component exit value --- libisoburn/trunk/releng/run_all_releng | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/libisoburn/trunk/releng/run_all_releng b/libisoburn/trunk/releng/run_all_releng index aa63294f..c4ef3cd1 100755 --- a/libisoburn/trunk/releng/run_all_releng +++ b/libisoburn/trunk/releng/run_all_releng @@ -129,9 +129,17 @@ fi T1=`date '+%s'` set +e - return_wrapper ./${s} ${PASSED_OPTIONS} 2>&1 | count_lines >> ${CLOG} - RET=$(cat "$return_value_file") - rm "$return_value_file" + if test -n "$PIPESTATUS" + then + # PIPESTATUS[0] should be available in bash + ./${s} ${PASSED_OPTIONS} 2>&1 | count_lines >> ${CLOG} + RET="${PIPESTATUS[0]}" + else + # a more portable method which uses a temporary file to record exit value + return_wrapper ./${s} ${PASSED_OPTIONS} 2>&1 | count_lines >> ${CLOG} + RET=$(cat "$return_value_file") + rm "$return_value_file" + fi # echo "RET='$RET'" >/dev/tty T2=`date '+%s'`