Skip to content

Commit 3eb6715

Browse files
committed
case-lib: hijack.sh use trap to hijack exit command
use 'trap' command hijack exit command instead of function 'exit' which perpare for 'set -e' Signed-off-by: Wu, BinX <binx.wu@intel.com>
1 parent b4fe945 commit 3eb6715

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

case-lib/hijack.sh

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,9 @@
22

33
SUDO_CMD=$(command -v sudo)
44

5+
trap 'func_exit_handler' EXIT
56
# Overwrite other functions' exit to perform environment cleanup
6-
function exit()
7+
function func_exit_handler()
78
{
89
local exit_status=${1:-0}
910

0 commit comments

Comments
 (0)