Xinqi Bao's Git
projects
/
slstatus.git
/ blobdiff
summary
|
log
|
commit
|
diff
|
tree
raw
|
inline
| side by side
Clean up header includes
[slstatus.git]
/
components
/
disk.c
diff --git
a/components/disk.c
b/components/disk.c
index
db18d12
..
9d2284e
100644
(file)
--- a/
components/disk.c
+++ b/
components/disk.c
@@
-1,7
+1,5
@@
/* See LICENSE file for copyright and license details. */
/* See LICENSE file for copyright and license details. */
-#include <errno.h>
#include <stdio.h>
#include <stdio.h>
-#include <string.h>
#include <sys/statvfs.h>
#include "../util.h"
#include <sys/statvfs.h>
#include "../util.h"
@@
-16,7
+14,7
@@
disk_free(const char *mnt)
return NULL;
}
return NULL;
}
- return fmt_
scaled(fs.f_frsize * fs.f_bavail
);
+ return fmt_
human(fs.f_frsize * fs.f_bavail, 1024
);
}
const char *
}
const char *
@@
-29,7
+27,7
@@
disk_perc(const char *mnt)
return NULL;
}
return NULL;
}
- return bprintf("%d
%%
", (int)(100 *
+ return bprintf("%d", (int)(100 *
(1.0f - ((float)fs.f_bavail / (float)fs.f_blocks))));
}
(1.0f - ((float)fs.f_bavail / (float)fs.f_blocks))));
}
@@
-43,7
+41,7
@@
disk_total(const char *mnt)
return NULL;
}
return NULL;
}
- return fmt_
scaled(fs.f_frsize * fs.f_blocks
);
+ return fmt_
human(fs.f_frsize * fs.f_blocks, 1024
);
}
const char *
}
const char *
@@
-56,5
+54,5
@@
disk_used(const char *mnt)
return NULL;
}
return NULL;
}
- return fmt_
scaled(fs.f_frsize * (fs.f_blocks - fs.f_bfree)
);
+ return fmt_
human(fs.f_frsize * (fs.f_blocks - fs.f_bfree), 1024
);
}
}