]> git.ipfire.org Git - thirdparty/util-linux.git/commit
prlimit: fix case when PID is given later
authorBernhard Voelker <mail@bernhard-voelker.de>
Wed, 16 Nov 2011 10:55:43 +0000 (11:55 +0100)
committerKarel Zak <kzak@redhat.com>
Wed, 16 Nov 2011 10:55:43 +0000 (11:55 +0100)
commit044bc8de2d22a06f7253888460e7a32d4b367c8e
tree2c8d1a122ad8bc213a8a0c4a08830279576ff539
parentf88e44be572d255d4b67843ae1cb32da3409bf8e
prlimit: fix case when PID is given later

 # prlimit --nofile=:4000 --pid $$

When the PID is given later than a partially given limit, then prlimit
used the current PID for getting the missing part (hard, soft) of the
limit.

Factored out the retrieval of the unknown limit from parse_prlim() to
new get_unknown_hardsoft() which is to be called by do_prlimit() based
on the struct prlimit member 'modify' set by add_prlim().

[kzak@redhat.com: - use prlimit->mofify as mask
                  - add soft vs. hard limit check from another
                    Bernhard's patch]

Signed-off-by: Bernhard Voelker <mail@bernhard-voelker.de>
Signed-off-by: Karel Zak <kzak@redhat.com>
sys-utils/prlimit.c