pkgsrc/devel/xulrunner17/patches/patch-aw
ryoon 27af90c8a6 Import xulrunner17-17.0.2 as devel/xulrunner17.
XULRunner is a runtime environment for applications using the
XML User Interface Language, XUL. It is the successor of the "Gecko"
runtime environment.

This package tracks 17.0.x extended support release.
2013-01-10 16:17:09 +00:00

34 lines
956 B
Text

$NetBSD: patch-aw,v 1.1 2013/01/10 16:17:10 ryoon Exp $
--- xulrunner/stub/nsXULStub.cpp.orig 2012-10-04 15:51:30.000000000 +0000
+++ xulrunner/stub/nsXULStub.cpp
@@ -11,6 +11,29 @@
#include "nsIFile.h"
#include <stdarg.h>
+#if defined(__NetBSD__)
+#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");
+}
+#endif
#ifdef XP_WIN
#include <windows.h>