From 7e88f61717ece1ba6f08262fcbd0f8e3855741d0 Mon Sep 17 00:00:00 2001 From: Karel Zak Date: Wed, 19 Dec 2012 15:27:12 +0100 Subject: ipcs: make --human really sexy Align the "size" columns to the right. Signed-off-by: Karel Zak --- sys-utils/ipcs.c | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) (limited to 'sys-utils/ipcs.c') diff --git a/sys-utils/ipcs.c b/sys-utils/ipcs.c index d611354c7..4aecc4134 100644 --- a/sys-utils/ipcs.c +++ b/sys-utils/ipcs.c @@ -313,7 +313,12 @@ static void do_shm (char format, int unit) else printf ("%-10d %-10u", shmdsp->shm_perm.id, shmdsp->shm_perm.uid); printf (" %-10o ", shmdsp->shm_perm.mode & 0777); - ipc_print_size(unit, NULL, shmdsp->shm_segsz, NULL, -10); + + if (unit == IPC_UNIT_HUMAN) + ipc_print_size(unit, NULL, shmdsp->shm_segsz, " ", 6); + else + ipc_print_size(unit, NULL, shmdsp->shm_segsz, NULL, -10); + printf (" %-10ld %-6s %-6s\n", shmdsp->shm_nattch, shmdsp->shm_perm.mode & SHM_DEST ? _("dest") : " ", @@ -530,7 +535,12 @@ static void do_msg (char format, int unit) else printf ("%-10d %-10u", msgdsp->msg_perm.id, msgdsp->msg_perm.uid); printf (" %-10o ", msgdsp->msg_perm.mode & 0777); - ipc_print_size(unit, NULL, msgdsp->q_cbytes, NULL, -12); + + if (unit == IPC_UNIT_HUMAN) + ipc_print_size(unit, NULL, msgdsp->q_cbytes, " ", 6); + else + ipc_print_size(unit, NULL, msgdsp->q_cbytes, NULL, -12); + printf (" %-12ld\n", msgdsp->q_qnum); break; } -- cgit v1.2.3-55-g7522