summaryrefslogtreecommitdiffstats
path: root/sys-utils/ipcs.c
diff options
context:
space:
mode:
authorKarel Zak2012-12-19 15:27:12 +0100
committerKarel Zak2012-12-19 15:27:12 +0100
commit7e88f61717ece1ba6f08262fcbd0f8e3855741d0 (patch)
tree0992ae1176c8a6c95f12875b72e7e5252db7a9f5 /sys-utils/ipcs.c
parentlib/ismounted: improve loopdev support (diff)
downloadkernel-qcow2-util-linux-7e88f61717ece1ba6f08262fcbd0f8e3855741d0.tar.gz
kernel-qcow2-util-linux-7e88f61717ece1ba6f08262fcbd0f8e3855741d0.tar.xz
kernel-qcow2-util-linux-7e88f61717ece1ba6f08262fcbd0f8e3855741d0.zip
ipcs: make --human really sexy
Align the "size" columns to the right. Signed-off-by: Karel Zak <kzak@redhat.com>
Diffstat (limited to 'sys-utils/ipcs.c')
-rw-r--r--sys-utils/ipcs.c14
1 files changed, 12 insertions, 2 deletions
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;
}