]> git.ipfire.org Git - thirdparty/util-linux.git/commit
lslocks: special-case PID for filtering (skip −1)
authorMasatake YAMATO <yamato@redhat.com>
Mon, 29 Dec 2025 07:22:24 +0000 (16:22 +0900)
committerMasatake YAMATO <yamato@redhat.com>
Mon, 29 Dec 2025 08:08:32 +0000 (17:08 +0900)
commitc492f0fc468de0fce6650501ea0e74ca2c687efd
treea6df808c53d0b9ef1d29adcc0197b03b28b5dda7
parent01f7ce772c552fe9c367dc21550426bda95f051c
lslocks: special-case PID for filtering (skip −1)

The PID column may be printed as −1 for locks that are not tied to a
process or are inaccessible to lslocks (e.g., permission constraints).
The libsmartcols filter engine does not support negative integers, so
PID = −1 cannot be compared reliably.

Attach the PID as cell userdata only when PID >= 0, and use that value
for filter evaluation. Rows with PID = −1 are thus excluded from PID
comparisons.

No change to printed output.

Signed-off-by: Masatake YAMATO <yamato@redhat.com>
misc-utils/lslocks.8.adoc
misc-utils/lslocks.c