hid: bump the FD limit

This commit is contained in:
Přemysl Eric Janouch 2022-08-02 22:10:05 +02:00
parent 442fa5d660
commit 5f0d5bca70
Signed by: p
GPG Key ID: A0420B94F92B9493

View File

@ -3493,6 +3493,14 @@ func main() {
os.Exit(2) os.Exit(2)
} }
// Note that this has become unnecessary since Go 1.19.
var limit syscall.Rlimit
if err := syscall.Getrlimit(syscall.RLIMIT_NOFILE, &limit); err == nil &&
limit.Cur != limit.Max {
limit.Cur = limit.Max
syscall.Setrlimit(syscall.RLIMIT_NOFILE, &limit)
}
config = make(simpleConfig) config = make(simpleConfig)
config.loadDefaults(configTable) config.loadDefaults(configTable)
if err := config.updateFromFile(); err != nil && !os.IsNotExist(err) { if err := config.updateFromFile(); err != nil && !os.IsNotExist(err) {