aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRob Landley <rob@landley.net>2012-04-14 21:27:00 -0500
committerRob Landley <rob@landley.net>2012-04-14 21:27:00 -0500
commit2a9dde00db289995b0dec48928c5e1656f7b9323 (patch)
tree7d553ad08fb6cf5000d73d8d6c252262999b9612
parentf69042e932fa4ca924101a1a73d7f805a9379e8f (diff)
downloadtoybox-2a9dde00db289995b0dec48928c5e1656f7b9323.tar.gz
Match uint64_t with PRIu64 to avoid warnings on 64 bit builds.
-rw-r--r--toys/vmstat.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/toys/vmstat.c b/toys/vmstat.c
index e186961d..2826ced5 100644
--- a/toys/vmstat.c
+++ b/toys/vmstat.c
@@ -35,14 +35,16 @@ void read_proc_stat(unsigned int * proc_running, unsigned int * proc_blocked,
off = strstr(toybuf, "cpu ");
// Ignoring steal and guest fields for now.
- if (off) sscanf(off, "cpu %Lu %Lu %Lu %Lu %Lu %Lu %Lu", &c_user, &c_nice, &c_sys, cpu_idle, cpu_wait, &c_irq, &c_sirq);
+ if (off) sscanf(off, "cpu %"PRIu64" %"PRIu64" %"PRIu64" %"PRIu64 \
+ " %"PRIu64" %"PRIu64" %"PRIu64, &c_user, &c_nice, &c_sys, cpu_idle,
+ cpu_wait, &c_irq, &c_sirq);
*cpu_user = c_user + c_nice;
*cpu_sys = c_sys + c_irq + c_sirq;
off = strstr(toybuf, "intr");
- if (off) sscanf(off, "intr %Lu", sys_irq);
+ if (off) sscanf(off, "intr %"PRIu64, sys_irq);
off = strstr(toybuf, "ctxt");
- if (off) sscanf(off, "ctxt %Lu", sys_ctxt);
+ if (off) sscanf(off, "ctxt %"PRIu64, sys_ctxt);
off = strstr(toybuf, "procs_running");
if (off) sscanf(off, "procs_running %u", proc_running);