X-Git-Url: https://zdv2.bktei.com/gitweb/EVA-2020-02.git/blobdiff_plain/3370febe9abfaa4da92ad57fc39b22295a160057..c503eb7ba7d5a806a791da481bdee5dd240e995f:/exec/bkgpslog diff --git a/exec/bkgpslog b/exec/bkgpslog index 9e23f01..4678c1e 100755 --- a/exec/bkgpslog +++ b/exec/bkgpslog @@ -999,7 +999,10 @@ magicBufferSleepPID() { yell "WARNING:Buffer lag adjustment yielded negative seconds."; fi; ## Calculate nanosecond remainder - BUFFER_TTL_ADJ_FLOATFRAC="$((BUFFER_TTL_NS - (BUFFER_TTL_ADJ_INT*(10**9)) ))" && vbm "BUFFER_TTL_ADJ_FLOATFRAC:$BUFFER_TTL_ADJ_FLOATFRAC"; + ### Remove integer + BUFFER_TTL_ADJ_FLOATFRAC="$((BUFFER_TTL_ADJ_NS - (BUFFER_TTL_ADJ_INT*(10**9)) ))" && vbm "BUFFER_TTL_ADJ_FLOATFRAC:$BUFFER_TTL_ADJ_FLOATFRAC"; + ### Calc absolute value of fraction (by removing '-' if present; see https://stackoverflow.com/a/47240327 + BUFFER_TTL_ADJ_FLOATFRAC="${BUFFER_TTL_ADJ_FLOAT_FRAC#-}" && vbm "BUFFER_TTL_ADJ_FLOATFRAC:$BUFFER_TTL_ADJ_FLOATFRAC"; ## Form float BUFFER_TTL_ADJ_FLOAT BUFFER_TTL_ADJ_FLOAT="$BUFFER_TTL_ADJ_INT"."$BUFFER_TTL_ADJ_FLOATFRAC" && vbm "BUFFER_TTL_ADJ_FLOAT:$BUFFER_TTL_ADJ_FLOAT"; vbm "STATUS:Calculated adjusted BUFFER_TTL (seconds):$BUFFER_TTL_ADJ_FLOAT";