]> git.ipfire.org Git - thirdparty/util-linux.git/commit
ipcs: fix ipc_msg_get_info fallback case
authorRuediger Meier <ruediger.meier@ga-group.nl>
Wed, 12 Mar 2014 13:53:20 +0000 (14:53 +0100)
committerRuediger Meier <ruediger.meier@ga-group.nl>
Thu, 13 Mar 2014 22:23:25 +0000 (23:23 +0100)
commit08e7d10bd8a7894a6f83396bad337396b7191de7
tree81a4d1f9c6958d94cc2ab5bea38ce6b94b9c585c
parent4e11f7a5d237185815bae5115b44c9c7a275cbe5
ipcs: fix ipc_msg_get_info fallback case

"ipcs -q" (case id < 0) was broken since v2.22-256-g35118df if /sys
is not usable. The main issue was that the use of msqid argument did not
cleanly distinguished between "queue identifier" and "index of kernel's
internal array".

Also now the fallback case and the regular case behave more equally
regarding it's return value (introducing another counter j).

Note that the case id >= 0 now performs a slower lookup. This could be
avoided but then we would better handle both case differently like it
was before the above mentioned cleanup commit.

Signed-off-by: Ruediger Meier <ruediger.meier@ga-group.nl>
sys-utils/ipcutils.c