Skip to content

Conversation

@Bin-QA
Copy link
Contributor

@Bin-QA Bin-QA commented Jun 8, 2020

direct to trap 'func' exit command
will load the exit code of exit command
use trap 'func $?' exit to passdown exit code
to the function

Signed-off-by: Wu, BinX binx.wu@intel.com

direct to `trap 'func' exit` command
will load the exit code of exit command
use `trap 'func $?' exit` to passdown exit code
to the function

Signed-off-by: Wu, BinX <binx.wu@intel.com>
@Bin-QA Bin-QA requested review from marc-hb and xiulipan as code owners June 8, 2020 02:50
Copy link

@aiChaoSONG aiChaoSONG left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@aiChaoSONG
Copy link

As we lost exit code without this patch, test case is highly impacted, I will merge this.

@aiChaoSONG aiChaoSONG merged commit fd5a73e into thesofproject:master Jun 8, 2020
@marc-hb
Copy link
Collaborator

marc-hb commented Jun 8, 2020

Could you also do this? A default value doesn't make sense anymore, $? always exists.

--- a/case-lib/hijack.sh
+++ b/case-lib/hijack.sh
@@ -6,7 +6,7 @@ trap 'func_exit_handler $?' EXIT
 # Overwrite other functions' exit to perform environment cleanup
 function func_exit_handler()
 {
-    local exit_status=${1:-0}
+    local exit_status="$1"
 
     # when sof logger collect is open
     if [ "X$SOF_LOG_COLLECT" == "X1" ]; then

@Bin-QA
Copy link
Contributor Author

Bin-QA commented Jun 9, 2020

@marc-hb yes, it looks have some gap with original design, you also can submit the PR to fix it :)

@marc-hb
Copy link
Collaborator

marc-hb commented Jun 9, 2020

you also can submit the PR to fix it :)

I don't submit without testing, what is the easiest way to test this particular code locally? I see @plbossart filed a number of usability issues.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants