Xinqi Bao's Git
projects
/
slstatus.git
/ blobdiff
summary
|
log
|
commit
|
diff
|
tree
raw
|
inline
| side by side
Change uint64_t to uintmax_t
[slstatus.git]
/
components
/
uptime.c
diff --git
a/components/uptime.c
b/components/uptime.c
index
f957f17
..
67acbf7
100644
(file)
--- a/
components/uptime.c
+++ b/
components/uptime.c
@@
-8,7
+8,7
@@
const char *
uptime(void)
{
const char *
uptime(void)
{
- uint
64
_t h, m;
+ uint
max
_t h, m;
struct timespec uptime;
if (clock_gettime(CLOCK_BOOTTIME, &uptime) < 0) {
struct timespec uptime;
if (clock_gettime(CLOCK_BOOTTIME, &uptime) < 0) {
@@
-19,5
+19,5
@@
uptime(void)
h = uptime.tv_sec / 3600;
m = uptime.tv_sec % 3600 / 60;
h = uptime.tv_sec / 3600;
m = uptime.tv_sec % 3600 / 60;
- return bprintf("%" PRIu
64 "h %" PRIu64
"m", h, m);
+ return bprintf("%" PRIu
MAX "h %" PRIuMAX
"m", h, m);
}
}