Skip to content

case-lib: hijack.sh fix trap exit command - #249

Merged
aiChaoSONG merged 1 commit into
thesofproject:masterfrom
Bin-QA:exit
Jun 8, 2020
Merged

case-lib: hijack.sh fix trap exit command#249
aiChaoSONG merged 1 commit into
thesofproject:masterfrom
Bin-QA:exit

Conversation

@Bin-QA

Copy link
Copy Markdown
Contributor

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>

@aiChaoSONGaiChaoSONG left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

LGTM

@aiChaoSONG

Copy link
Copy Markdown

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

@aiChaoSONG
aiChaoSONG merged commit fd5a73e into thesofproject:masterJun 8, 2020
@marc-hb

Copy link
Copy Markdown
Collaborator

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
Copy Markdown
ContributorAuthor

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

@marc-hb

Copy link
Copy Markdown
Collaborator

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 freeto 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

@Bin-QA@aiChaoSONG@marc-hb