update the max if cur will be greater than max for setting the limit
Signed-off-by: Su Fei <sofat1989@126.com>
This commit is contained in:
parent
4a2f61c4f2
commit
5cab0d3f3f
@ -31,6 +31,9 @@ func setRlimit() error {
|
||||
}
|
||||
if limit.Cur < rlimit {
|
||||
limit.Cur = rlimit
|
||||
if limit.Max < limit.Cur {
|
||||
limit.Max = limit.Cur
|
||||
}
|
||||
if err := syscall.Setrlimit(syscall.RLIMIT_NOFILE, &limit); err != nil {
|
||||
return err
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user