From: Karel Zak Date: Mon, 3 Aug 2015 11:20:56 +0000 (+0200) Subject: lsipc: ifdef SHM_* macros X-Git-Tag: v2.27-rc2~56 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=21ce5a5d70086ebd6abb257d4a3b75ac1a36742c;p=thirdparty%2Futil-linux.git lsipc: ifdef SHM_* macros Reported-by: Andreas Henriksson Signed-off-by: Karel Zak --- 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;