mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-08-20 02:42:27 +00:00
common/fdlimit: return error if OPEN_MAX is exceeded in Raise()
This commit is contained in:
parent
db23b9547b
commit
75e2910312
1 changed files with 2 additions and 2 deletions
|
|
@ -1,4 +1,4 @@
|
|||
// Copyright 2016 The go-ethereum Authors
|
||||
// Copyright 2019 The go-ethereum Authors
|
||||
// This file is part of the go-ethereum library.
|
||||
//
|
||||
// The go-ethereum library is free software: you can redistribute it and/or modify
|
||||
|
|
@ -39,7 +39,7 @@ func Raise(max uint64) error {
|
|||
//
|
||||
// OPEN_MAX is 10240
|
||||
if limit.Cur > 10240 {
|
||||
limit.Cur = 10240
|
||||
return errors.New("darwin only allows OPEN_MAX (10240) open files")
|
||||
}
|
||||
if err := syscall.Setrlimit(syscall.RLIMIT_NOFILE, &limit); err != nil {
|
||||
return err
|
||||
|
|
|
|||
Loading…
Reference in a new issue