diff options
author | Martin Holst Swende <martin@swende.se> | 2019-02-12 18:29:05 +0800 |
---|---|---|
committer | Péter Szilágyi <peterke@gmail.com> | 2019-02-12 18:29:05 +0800 |
commit | f48da43bae183a04a23d298cb1790d2f8d2cec51 (patch) | |
tree | 5ae2949a5bf711f913b2bbd57962906c3a721698 /cmd/utils | |
parent | 3de19c8b31ab975eed1f7f276d31761f7f8b9af9 (diff) | |
download | go-tangerine-f48da43bae183a04a23d298cb1790d2f8d2cec51.tar go-tangerine-f48da43bae183a04a23d298cb1790d2f8d2cec51.tar.gz go-tangerine-f48da43bae183a04a23d298cb1790d2f8d2cec51.tar.bz2 go-tangerine-f48da43bae183a04a23d298cb1790d2f8d2cec51.tar.lz go-tangerine-f48da43bae183a04a23d298cb1790d2f8d2cec51.tar.xz go-tangerine-f48da43bae183a04a23d298cb1790d2f8d2cec51.tar.zst go-tangerine-f48da43bae183a04a23d298cb1790d2f8d2cec51.zip |
common/fdlimit: cap on MacOS file limits, fixes #18994 (#19035)
* common/fdlimit: cap on MacOS file limits, fixes #18994
* common/fdlimit: fix Maximum-check to respect OPEN_MAX
* common/fdlimit: return error if OPEN_MAX is exceeded in Raise()
* common/fdlimit: goimports
* common/fdlimit: check value after setting fdlimit
* common/fdlimit: make comment a bit more descriptive
* cmd/utils: make fdlimit happy path a bit cleaner
Diffstat (limited to 'cmd/utils')
-rw-r--r-- | cmd/utils/flags.go | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/cmd/utils/flags.go b/cmd/utils/flags.go index 66f533102..22b7eb3d2 100644 --- a/cmd/utils/flags.go +++ b/cmd/utils/flags.go @@ -950,10 +950,11 @@ func makeDatabaseHandles() int { if err != nil { Fatalf("Failed to retrieve file descriptor allowance: %v", err) } - if err := fdlimit.Raise(uint64(limit)); err != nil { + raised, err := fdlimit.Raise(uint64(limit)) + if err != nil { Fatalf("Failed to raise file descriptor allowance: %v", err) } - return limit / 2 // Leave half for networking and other stuff + return int(raised / 2) // Leave half for networking and other stuff } // MakeAddress converts an account specified directly as a hex encoded string or |