From 4344d34242c27734a2940ab5f995c7b9fb4803e2 Mon Sep 17 00:00:00 2001 From: Laurent Bercot Date: Sun, 6 Sep 2026 05:19:15 +0000 Subject: s6-softlimit -h: actually lower the soft limit if needed --- src/daemontools-extras/s6-softlimit.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'src/daemontools-extras') diff --git a/src/daemontools-extras/s6-softlimit.c b/src/daemontools-extras/s6-softlimit.c index beb7325..11f38eb 100644 --- a/src/daemontools-extras/s6-softlimit.c +++ b/src/daemontools-extras/s6-softlimit.c @@ -25,7 +25,11 @@ static void doit (int res, char const *arg) { uint64_t n ; if (!uint640_scan(arg, &n)) strerr_dieusage(100, USAGE) ; - if (what & 2) r.rlim_max = n ; + if (what & 2) + { + r.rlim_max = n ; + if (!(what & 1) && r.rlim_cur > n) r.rlim_cur = n ; + } if (what & 1) { if (n > r.rlim_max) n = r.rlim_max ; -- cgit v1.3.1