From 21ce5a5d70086ebd6abb257d4a3b75ac1a36742c Mon Sep 17 00:00:00 2001 From: Karel Zak Date: Mon, 3 Aug 2015 13:20:56 +0200 Subject: [PATCH] lsipc: ifdef SHM_* macros Reported-by: Andreas Henriksson Signed-off-by: Karel Zak --- sys-utils/lsipc.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/sys-utils/lsipc.c b/sys-utils/lsipc.c index f83e6ca9b5..45bcb759b6 100644 --- a/sys-utils/lsipc.c +++ b/sys-utils/lsipc.c @@ -1020,26 +1020,33 @@ static void do_shm(int id, struct lsipc_control *ctl, struct libscols_table *tb) + strlen(_("locked")) + strlen(_("hugetlb")) + strlen(_("noreserve")) + 4); - +#ifdef SHM_DEST if (shmdsp->shm_perm.mode & SHM_DEST) { offt += sprintf(arg, "%s", _("dest")); comma++; } +#endif +#ifdef SHM_LOCKED if (shmdsp->shm_perm.mode & SHM_LOCKED) { if (comma) arg[offt++] = ','; offt += sprintf(arg + offt, "%s", _("locked")); } +#endif +#ifdef SHM_HUGETLB if (shmdsp->shm_perm.mode & SHM_HUGETLB) { if (comma) arg[offt++] = ','; offt += sprintf(arg + offt, "%s", _("hugetlb")); } +#endif +#ifdef SHM_NORESERVE if (shmdsp->shm_perm.mode & SHM_NORESERVE) { if (comma) arg[offt++] = ','; sprintf(arg + offt, "%s", _("noreserve")); } +#endif rc = scols_line_set_data(ln, n, arg); } break; -- 2.47.2