From 12382335564ff91d0647408e3a105ba0b30b03e9 Mon Sep 17 00:00:00 2001 From: Přemysl Eric Janouch
Date: Tue, 2 Aug 2022 22:10:05 +0200 Subject: hid: bump the FD limit --- xS/main.go | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'xS/main.go') diff --git a/xS/main.go b/xS/main.go index cf57b5e..40f47bc 100644 --- a/xS/main.go +++ b/xS/main.go @@ -3493,6 +3493,14 @@ func main() { 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.loadDefaults(configTable) if err := config.updateFromFile(); err != nil && !os.IsNotExist(err) { -- cgit v1.2.3-70-g09d2