summaryrefslogtreecommitdiff
path: root/mail/thunderbird/patches/patch-zc
diff options
context:
space:
mode:
Diffstat (limited to 'mail/thunderbird/patches/patch-zc')
-rw-r--r--mail/thunderbird/patches/patch-zc40
1 files changed, 40 insertions, 0 deletions
diff --git a/mail/thunderbird/patches/patch-zc b/mail/thunderbird/patches/patch-zc
new file mode 100644
index 00000000000..e9b48f5cd0d
--- /dev/null
+++ b/mail/thunderbird/patches/patch-zc
@@ -0,0 +1,40 @@
+$NetBSD: patch-zc,v 1.1 2009/11/29 03:06:44 tnn Exp $
+
+--- mail/app/nsMailApp.cpp.orig 2009-11-22 03:44:31.000000000 +0100
++++ mail/app/nsMailApp.cpp
+@@ -44,6 +44,27 @@
+
+ #include <stdio.h>
+ #include <stdarg.h>
++#include <sys/resource.h>
++/*
++ * On netbsd-4, ulimit -n is 64 by default; too few for us.
++ */
++static void netbsd_fixrlimit(void) {
++ struct rlimit rlp;
++ if (getrlimit(RLIMIT_NOFILE, &rlp) == -1) {
++ fprintf(stderr, "warning: getrlimit failed\n");
++ return;
++ }
++ if (rlp.rlim_cur >= 512)
++ return;
++ if (rlp.rlim_max < 512) {
++ fprintf(stderr, "warning: hard limit of 'ulimit -n' too low\n");
++ rlp.rlim_cur = rlp.rlim_max;
++ }
++ else
++ rlp.rlim_cur = 512;
++ if (setrlimit(RLIMIT_NOFILE, &rlp) == -1)
++ fprintf(stderr, "warning: setrlimit failed\n");
++}
+
+ #include "nsCOMPtr.h"
+ #include "nsILocalFile.h"
+@@ -83,6 +104,7 @@ public:
+
+ int main(int argc, char* argv[])
+ {
++ netbsd_fixrlimit();
+ ScopedLogging log;
+
+ nsCOMPtr<nsILocalFile> appini;