Avoid displaying negative free space

This commit is contained in:
df 2020-12-11 11:18:58 +00:00
parent d7c15163e1
commit 0ad1491634

View File

@ -9,6 +9,11 @@ lassign [system diskspace 1] size used perc free fperc tsrbuf tsrused
set tsrreserve $($tsrbuf - $tsrused)
# Adjust values to account for the TSR reserve
set free $($free - $tsrreserve)
# In case the reserve has been over-committed
if {$free < 0)} {
# avoid displaying negative free, or used > available
set free 0
}
set used $($size - $free)
set dbs 0