corrected calculations for disk space on openbsd
This commit is contained in:
parent
1b3fafd77e
commit
0f46c675d3
1 changed files with 4 additions and 4 deletions
|
@ -17,7 +17,7 @@ disk_free(const char *mnt)
|
||||||
}
|
}
|
||||||
|
|
||||||
return bprintf("%f",
|
return bprintf("%f",
|
||||||
(float)fs.f_bsize * (float)fs.f_bfree / 1024 / 1024 / 1024);
|
(float)fs.f_frsize * (float)fs.f_bavail / 1024 / 1024 / 1024);
|
||||||
}
|
}
|
||||||
|
|
||||||
const char *
|
const char *
|
||||||
|
@ -31,7 +31,7 @@ disk_perc(const char *mnt)
|
||||||
}
|
}
|
||||||
|
|
||||||
return bprintf("%d", (int)(100 *
|
return bprintf("%d", (int)(100 *
|
||||||
(1.0f - ((float)fs.f_bfree / (float)fs.f_blocks))));
|
(1.0f - ((float)fs.f_bavail / (float)fs.f_blocks))));
|
||||||
}
|
}
|
||||||
|
|
||||||
const char *
|
const char *
|
||||||
|
@ -45,7 +45,7 @@ disk_total(const char *mnt)
|
||||||
}
|
}
|
||||||
|
|
||||||
return bprintf("%f",
|
return bprintf("%f",
|
||||||
(float)fs.f_bsize * (float)fs.f_blocks / 1024 / 1024 / 1024);
|
(float)fs.f_frsize * (float)fs.f_blocks / 1024 / 1024 / 1024);
|
||||||
}
|
}
|
||||||
|
|
||||||
const char *
|
const char *
|
||||||
|
@ -59,6 +59,6 @@ disk_used(const char *mnt)
|
||||||
}
|
}
|
||||||
|
|
||||||
return bprintf("%f",
|
return bprintf("%f",
|
||||||
(float)fs.f_bsize * ((float)fs.f_blocks -
|
(float)fs.f_frsize * ((float)fs.f_blocks -
|
||||||
(float)fs.f_bfree) / 1024 / 1024 / 1024);
|
(float)fs.f_bfree) / 1024 / 1024 / 1024);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue