diff options
| author | Roland Veloz <rveloz@us.ibm.com> | 2018-01-04 19:42:23 -0600 |
|---|---|---|
| committer | Daniel M. Crowell <dcrowell@us.ibm.com> | 2018-01-16 11:33:24 -0500 |
| commit | dfb142acec4374e23a3de5fd45b232b8acd6403b (patch) | |
| tree | cb6b67b0dc911dc8e5ca744736a4652cf6d363b5 /src/build/citest/setup-env | |
| parent | 1e973575493db7b15d6cd36613034e3ea17ca900 (diff) | |
| download | talos-hostboot-dfb142acec4374e23a3de5fd45b232b8acd6403b.tar.gz talos-hostboot-dfb142acec4374e23a3de5fd45b232b8acd6403b.zip | |
Corrected issue with hb errlparser not exiting on error
The code was doing a lot of negative one returns and exits when it
should be passing values from 0 - 255 (0 being success and 1 to 255
indicating failure.) Also, why return a different error when you
have a perfectly good error code already there. So I return the
current error code.
Change-Id: I485e6abcfded39ad8121de109f16e587c53f1f81
CQ: SW326835
Reviewed-on: http://ralgit01.raleigh.ibm.com/gerrit1/51507
Tested-by: Jenkins Server <pfd-jenkins+hostboot@us.ibm.com>
Tested-by: Jenkins OP Build CI <op-jenkins+hostboot@us.ibm.com>
Tested-by: Jenkins OP HW <op-hw-jenkins+hostboot@us.ibm.com>
Tested-by: FSP CI Jenkins <fsp-CI-jenkins+hostboot@us.ibm.com>
Reviewed-by: Christian R. Geddes <crgeddes@us.ibm.com>
Reviewed-by: Elizabeth K. Liner <eliner@us.ibm.com>
Reviewed-by: Daniel M. Crowell <dcrowell@us.ibm.com>
Diffstat (limited to 'src/build/citest/setup-env')
| -rwxr-xr-x | src/build/citest/setup-env | 17 |
1 files changed, 14 insertions, 3 deletions
diff --git a/src/build/citest/setup-env b/src/build/citest/setup-env index 36224845c..904101ad1 100755 --- a/src/build/citest/setup-env +++ b/src/build/citest/setup-env @@ -6,7 +6,7 @@ # # OpenPOWER HostBoot Project # -# Contributors Listed Below - COPYRIGHT 2014,2016 +# Contributors Listed Below - COPYRIGHT 2014,2018 # [+] International Business Machines Corp. # # @@ -71,12 +71,23 @@ execute_in_sandbox() ${WORKON_CMD} -c ./sandbox_execute_cmd - if [ $? -ne 0 ]; then + # capture the return code from previous command + rc=$? + + # If return code is not 0 (indicating failure), do some + # cleanup and perpetuate the return code up the call chain. + # For sh/bash, should use 0 for success and 1 to 255 for failures, don't use + # negative numbers (-1). The shell interprets the '-' as an option + # for the return command. If you insist on using negative numbers + # do '-- -<n>' to use the negative number, however it will be interpreted + # as a positive number (-1 will become 255.) + if [ $rc -ne 0 ]; then rm ${SANDBOXBASE}/src/sandbox_execute_cmd - return -1 + return $rc fi rm ${SANDBOXBASE}/src/sandbox_execute_cmd + return 0; } export -f execute_in_sandbox |

