- fixed placement of "function atexit" wrt shell exit trap handler
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@1719 c6295689-39f2-0310-b995-f0e70906c6a9
This commit is contained in:
parent
4f6a7922d8
commit
6ef9257c54
|
@ -23,9 +23,6 @@ if [ -z "$__p15init__" ]; then
|
|||
exit 1
|
||||
done
|
||||
|
||||
mkdir -p $p15temp
|
||||
trap atexit 0 1 2 13 15
|
||||
|
||||
# Eat any arguments given on the command line
|
||||
while [ $# -ne 0 ]; do
|
||||
case $1 in
|
||||
|
@ -68,28 +65,31 @@ if [ -z "$__p15init__" ]; then
|
|||
__black=
|
||||
fi
|
||||
|
||||
test_failed=false
|
||||
|
||||
function atexit {
|
||||
|
||||
if ! $test_failed; then
|
||||
test "$p15temp" && rm -rf $p15temp
|
||||
msg <<-EOF
|
||||
:::
|
||||
::: ${__green}Test set completed successfully${__black}
|
||||
:::
|
||||
EOF
|
||||
fi
|
||||
}
|
||||
|
||||
mkdir -p $p15temp
|
||||
trap atexit 0 1 2 13 15
|
||||
|
||||
# Redirect output to log file, but keep copies of
|
||||
# stdout/stderr descriptors on fd 3 and 4
|
||||
exec 3>&1 4>&2 >$p15log 2>&1
|
||||
|
||||
test_failed=false
|
||||
fi
|
||||
|
||||
# Clobber log file
|
||||
cp /dev/null $p15log
|
||||
|
||||
function atexit {
|
||||
|
||||
if ! $test_failed; then
|
||||
test "$p15temp" && rm -rf $p15temp
|
||||
msg <<-EOF
|
||||
:::
|
||||
::: ${__green}Test set completed successfully${__black}
|
||||
:::
|
||||
EOF
|
||||
fi
|
||||
}
|
||||
|
||||
function msg {
|
||||
|
||||
if [ $# -eq 0 ]; then
|
||||
|
|
Loading…
Reference in New Issue