Xinqi Bao's Git
projects
/
slstatus.git
/ blobdiff
summary
|
log
|
commit
|
diff
|
tree
raw
|
inline
| side by side
wifi: Change memmove to memcpy on OpenBSD
[slstatus.git]
/
components
/
disk.c
diff --git
a/components/disk.c
b/components/disk.c
index
a225421
..
bf69875
100644
(file)
--- a/
components/disk.c
+++ b/
components/disk.c
@@
-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 *
@@
-30,8
+30,8
@@
disk_perc(const char *mnt)
return NULL;
}
return NULL;
}
- return bprintf("%d", 100 *
-
(1.0f - ((float)fs.f_bfree / (float)fs.f_blocks
)));
+ return bprintf("%d",
(int)(
100 *
+
(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_
b
size * (float)fs.f_blocks / 1024 / 1024 / 1024);
+ (float)fs.f_
fr
size * (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_
b
size * ((float)fs.f_blocks -
+ (float)fs.f_
fr
size * ((float)fs.f_blocks -
(float)fs.f_bfree) / 1024 / 1024 / 1024);
}
(float)fs.f_bfree) / 1024 / 1024 / 1024);
}