diff options
author | Přemysl Eric Janouch <p@janouch.name> | 2022-08-02 22:10:05 +0200 |
---|---|---|
committer | Přemysl Eric Janouch <p@janouch.name> | 2022-08-02 22:10:31 +0200 |
commit | 12382335564ff91d0647408e3a105ba0b30b03e9 (patch) | |
tree | ce3c920cdd97edec881442febb6a9fb9d5556824 /xS | |
parent | 9c31fb69dfe8e2daa17990d317e860df7d163dc3 (diff) | |
download | xK-12382335564ff91d0647408e3a105ba0b30b03e9.tar.gz xK-12382335564ff91d0647408e3a105ba0b30b03e9.tar.xz xK-12382335564ff91d0647408e3a105ba0b30b03e9.zip |
hid: bump the FD limit
Diffstat (limited to 'xS')
-rw-r--r-- | xS/main.go | 8 |
1 files changed, 8 insertions, 0 deletions
@@ -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) { |