Implement fmt_scaled for disk_* functions
This commit is contained in:
parent
35219d39ca
commit
b3e56066ed
|
@ -16,8 +16,7 @@ disk_free(const char *mnt)
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
return bprintf("%f",
|
return fmt_scaled(fs.f_frsize * fs.f_bavail);
|
||||||
(float)fs.f_frsize * (float)fs.f_bavail / 1024 / 1024 / 1024);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
const char *
|
const char *
|
||||||
|
@ -44,8 +43,7 @@ disk_total(const char *mnt)
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
return bprintf("%f",
|
return fmt_scaled(fs.f_frsize * fs.f_blocks);
|
||||||
(float)fs.f_frsize * (float)fs.f_blocks / 1024 / 1024 / 1024);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
const char *
|
const char *
|
||||||
|
@ -58,7 +56,5 @@ disk_used(const char *mnt)
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
return bprintf("%f",
|
return fmt_scaled(fs.f_frsize * (fs.f_blocks - fs.f_bfree));
|
||||||
(float)fs.f_frsize * ((float)fs.f_blocks -
|
|
||||||
(float)fs.f_bfree) / 1024 / 1024 / 1024);
|
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue