]> git.ipfire.org Git - thirdparty/util-linux.git/commit
lsipc: fix semaphore USED counter
authorKarel Zak <kzak@redhat.com>
Tue, 26 Mar 2024 11:45:24 +0000 (12:45 +0100)
committerKarel Zak <kzak@redhat.com>
Tue, 26 Mar 2024 12:00:09 +0000 (13:00 +0100)
commitfa45a6e516065f489b1cfb924ec3fc06960e0839
treed7e16c1cbffd11967c6dc9f086f48a1ac466fc68
parent7af75457f9afce4dbea0d778a33c7689994c5343
lsipc: fix semaphore USED counter

The code incorrectly counts only with the first item in the linked
list (due to a typo). It seems rather fragile to use "semds" and
"semdsp" as variable names in the same code ...

 # lsipc -gs

Old:

 KEY ID PERMS OWNER NSEMS RESOURCE DESCRIPTION                                LIMIT USED  USE%
                          SEMMNI   Number of semaphore identifiers            32000    3 0.01%
                          SEMMNS   Total number of semaphores            1024000000  369 0.00%
                          SEMMSL   Max semaphores per semaphore set.          32000    -     -
                          SEMOPM   Max number of operations per semop(2)        500    -     -
                          SEMVMX   Semaphore max value                        32767    -     -

Fixed:

 KEY ID PERMS OWNER NSEMS RESOURCE DESCRIPTION                                LIMIT USED  USE%
                          SEMMNI   Number of semaphore identifiers            32000    3 0.01%
                          SEMMNS   Total number of semaphores            1024000000  156 0.00%
                          SEMMSL   Max semaphores per semaphore set.          32000    -     -
                          SEMOPM   Max number of operations per semop(2)        500    -     -
                          SEMVMX   Semaphore max value                        32767    -     -

Addresses: https://issues.redhat.com/browse/RHEL-30269
Signed-off-by: Karel Zak <kzak@redhat.com>
sys-utils/lsipc.c