On Sun, Oct 14, 2012 at 09:22:21PM +0100, Sami Kerola wrote: > And reindent the print_shm() function. > > Signed-off-by: Sami Kerola <kerolasa@xxxxxx> > --- > sys-utils/ipcs.c | 49 ++++++++++++++++++++++++++++--------------------- > 1 file changed, 28 insertions(+), 21 deletions(-) > > diff --git a/sys-utils/ipcs.c b/sys-utils/ipcs.c > index 960039e..cd3d14d 100644 > --- a/sys-utils/ipcs.c > +++ b/sys-utils/ipcs.c > @@ -308,6 +308,10 @@ static int shmctl_info_wrapper(int maxid, int id, struct shm_data **shmds, > &(shmdsp->shm_rss), > &(shmdsp->shm_swp) > ); > + if (-1 < id && id != shmdsp->shm_perm.id) { > + i--; > + continue; > + } And what action is expected when id == shmdsp->shm_perm.id ? What about if (id == shmdsp->shm_perm.id) break; otherwise ipcs -m -i <id> will return another entry. BTW, ./ipcs <something> &> new ipcs <something> &> old diff -u old new is nice way how found bugs... Karel -- Karel Zak <kzak@xxxxxxxxxx> http://karelzak.blogspot.com -- To unsubscribe from this list: send the line "unsubscribe util-linux" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html