From 75e2910312cbe5c8577886ae3c60e2286747f9f7 Mon Sep 17 00:00:00 2001 From: Martin Holst Swende Date: Mon, 11 Feb 2019 12:33:58 +0100 Subject: [PATCH] common/fdlimit: return error if OPEN_MAX is exceeded in Raise() --- common/fdlimit/fdlimit_darwin.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/common/fdlimit/fdlimit_darwin.go b/common/fdlimit/fdlimit_darwin.go index d1a9f1c122..e207bb7cd6 100644 --- a/common/fdlimit/fdlimit_darwin.go +++ b/common/fdlimit/fdlimit_darwin.go @@ -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