]> 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>
Wed, 27 Mar 2024 10:55:59 +0000 (11:55 +0100)
commitecc27ce4973bb29ebb52689a8b8f1700b1053596
tree7b66ba2f550d15fc5df32c930de5103c09e69625
parent2d8ca2cf86309adbeccd07cba36c753e28d12a1b
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>
(cherry picked from commit fa45a6e516065f489b1cfb924ec3fc06960e0839)
sys-utils/lsipc.c