aboutsummaryrefslogtreecommitdiff
path: root/procps
diff options
context:
space:
mode:
Diffstat (limited to 'procps')
-rw-r--r--procps/kill.c4
-rw-r--r--procps/ps.c15
2 files changed, 12 insertions, 7 deletions
diff --git a/procps/kill.c b/procps/kill.c
index e2b029d20..b3257492d 100644
--- a/procps/kill.c
+++ b/procps/kill.c
@@ -51,7 +51,9 @@ int kill_main(int argc, char **argv)
51 if (argc == 1) { 51 if (argc == 1) {
52 /* Print the whole signal list */ 52 /* Print the whole signal list */
53 for (signo = 1; signo < 32; signo++) { 53 for (signo = 1; signo < 32; signo++) {
54 puts(get_signame(signo)); 54 const char *name = get_signame(signo);
55 if (!isdigit(name[0]))
56 puts(name);
55 } 57 }
56 } else { /* -l <sig list> */ 58 } else { /* -l <sig list> */
57 while ((arg = *++argv)) { 59 while ((arg = *++argv)) {
diff --git a/procps/ps.c b/procps/ps.c
index 5128c3d59..55453131e 100644
--- a/procps/ps.c
+++ b/procps/ps.c
@@ -47,18 +47,21 @@ static void func_pgid(char *buf, int size, const procps_status_t *ps)
47 sprintf(buf, "%*u", size, ps->pgid); 47 sprintf(buf, "%*u", size, ps->pgid);
48} 48}
49 49
50static void func_vsz(char *buf, int size, const procps_status_t *ps) 50static void put_u(char *buf, int size, unsigned u)
51{ 51{
52 char buf5[5]; 52 char buf5[5];
53 smart_ulltoa5( ((unsigned long long)ps->vsz) << 10, buf5); 53 smart_ulltoa5( ((unsigned long long)u) << 10, buf5);
54 sprintf(buf, "%.*s", size, buf5); 54 sprintf(buf, "%.*s", size, buf5);
55} 55}
56 56
57static void func_vsz(char *buf, int size, const procps_status_t *ps)
58{
59 put_u(buf, size, ps->vsz);
60}
61
57static void func_rss(char *buf, int size, const procps_status_t *ps) 62static void func_rss(char *buf, int size, const procps_status_t *ps)
58{ 63{
59 char buf5[5]; 64 put_u(buf, size, ps->rss);
60 smart_ulltoa5( ((unsigned long long)ps->rss) << 10, buf5);
61 sprintf(buf, "%.*s", size, buf5);
62} 65}
63 66
64static void func_tty(char *buf, int size, const procps_status_t *ps) 67static void func_tty(char *buf, int size, const procps_status_t *ps)
@@ -383,7 +386,7 @@ int ps_main(int argc, char **argv)
383 len = printf("%5u %-8s %s ", 386 len = printf("%5u %-8s %s ",
384 p->pid, user, p->state); 387 p->pid, user, p->state);
385 else 388 else
386 len = printf("%5u %-8s %6ld %s ", 389 len = printf("%5u %-8s %6u %s ",
387 p->pid, user, p->vsz, p->state); 390 p->pid, user, p->vsz, p->state);
388 } 391 }
389 392