diff options
Diffstat (limited to 'src/daemontools-extras')
| -rw-r--r-- | src/daemontools-extras/s6-softlimit.c | 6 |
1 files changed, 5 insertions, 1 deletions
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 ; |
