`set +o` prints out the full command line which is echoed if "xtrace" is
enabled. this increases the verbosity of get_timeout_delays().
in this change, we follow the way of kill_daemons() to kill the extra
output. see
aefcf6d.
Signed-off-by: Kefu Chai <kchai@redhat.com>
# @return a list of sleep delays
#
function get_timeout_delays() {
- local saved_state=$(set +o)
- set +x
+ local trace=$(shopt -q -o xtrace && echo true || echo false)
+ $trace && shopt -u -o xtrace
local timeout=$1
local first_step=${2:-1}
if test "$(echo $total \< $timeout | bc -l)" = "1"; then
echo -n $(echo $timeout - $total | bc -l)
fi
- eval "$saved_state"
+ $trace && shopt -s -o xtrace
}
function test_get_timeout_delays() {