Commit 185727a5 authored by nimrod's avatar nimrod
Browse files

__run_duration returns 0 when it can't calculate the command run duration...

__run_duration returns 0 when it can't calculate the command run duration (when the shell doesn't have support for PS0, like ksh).
parent 36021745
Loading
Loading
Loading
Loading
+10 −6
Original line number Diff line number Diff line
@@ -211,12 +211,16 @@ match_ssl_pair () {
}

__run_duration () {
    # Assumes that $HOME/.prerun.$$ exists.
    if [ -f "$HOME/.prerun.$$" ]
    then
        local endtime starttime
        endtime="$(date +%s)"
        starttime="$(cat "$HOME/.prerun.$$")"
        rm "$HOME/.prerun.$$"
        echo "$(( endtime - starttime ))"
    else
        echo 0
    fi
}

__prerun () {