aboutsummaryrefslogtreecommitdiff
path: root/xS/main.go
diff options
context:
space:
mode:
Diffstat (limited to 'xS/main.go')
-rw-r--r--xS/main.go8
1 files changed, 8 insertions, 0 deletions
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) {