aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--include/libbb.h2
-rw-r--r--procps/ps.c8
2 files changed, 5 insertions, 5 deletions
diff --git a/include/libbb.h b/include/libbb.h
index 678c56109..6c6b4863c 100644
--- a/include/libbb.h
+++ b/include/libbb.h
@@ -891,7 +891,7 @@ typedef struct procps_status_t {
USE_SELINUX(char *context;)
/* Everything below must contain no ptrs to malloc'ed data:
* it is memset(0) for each process in procps_scan() */
- unsigned vsz, rss; /* we round it to kbytes */
+ unsigned long vsz, rss; /* we round it to kbytes */
unsigned long stime, utime;
unsigned pid;
unsigned ppid;
diff --git a/procps/ps.c b/procps/ps.c
index 805fe0615..f5c801d20 100644
--- a/procps/ps.c
+++ b/procps/ps.c
@@ -48,7 +48,7 @@ static void func_pgid(char *buf, int size, const procps_status_t *ps)
sprintf(buf, "%*u", size, ps->pgid);
}
-static void put_u(char *buf, int size, unsigned u)
+static void put_lu(char *buf, int size, unsigned long u)
{
char buf5[5];
smart_ulltoa5( ((unsigned long long)u) << 10, buf5);
@@ -57,12 +57,12 @@ static void put_u(char *buf, int size, unsigned u)
static void func_vsz(char *buf, int size, const procps_status_t *ps)
{
- put_u(buf, size, ps->vsz);
+ put_lu(buf, size, ps->vsz);
}
static void func_rss(char *buf, int size, const procps_status_t *ps)
{
- put_u(buf, size, ps->rss);
+ put_lu(buf, size, ps->rss);
}
static void func_tty(char *buf, int size, const procps_status_t *ps)
@@ -405,7 +405,7 @@ int ps_main(int argc, char **argv)
len = printf("%5u %-8s %s ",
p->pid, user, p->state);
else
- len = printf("%5u %-8s %6u %s ",
+ len = printf("%5u %-8s %6lu %s ",
p->pid, user, p->vsz, p->state);
}