about summary refs log tree commit diff stats
diff options
context:
space:
mode:
-rw-r--r--xxxterm.c5
-rw-r--r--xxxterm.h6
2 files changed, 9 insertions, 2 deletions
diff --git a/xxxterm.c b/xxxterm.c
index 4028ca0..818f3a2 100644
--- a/xxxterm.c
+++ b/xxxterm.c
@@ -7301,7 +7301,6 @@ main(int argc, char *argv[])
 	FILE			*f = NULL;
 	struct karg		a;
 	GIOChannel		*channel;
-	struct rlimit		rlp;
 
 	start_argv = argv;
 
@@ -7336,6 +7335,9 @@ main(int argc, char *argv[])
 	TAILQ_INIT(&shl);
 	TAILQ_INIT(&ua_list);
 
+#ifndef XT_RESOURCE_LIMITS_DISABLE
+	struct rlimit		rlp;
+
 	/* fiddle with ulimits */
 	if (getrlimit(RLIMIT_NOFILE, &rlp) == -1)
 		warn("getrlimit");
@@ -7351,6 +7353,7 @@ main(int argc, char *argv[])
 			    "descriptors, currently it has up to %d available",
 			   __progname, rlp.rlim_cur);
 	}
+#endif
 
 	while ((c = getopt(argc, argv, "STVf:s:tne")) != -1) {
 		switch (c) {
diff --git a/xxxterm.h b/xxxterm.h
index cb30c3e..0b8cc7f 100644
--- a/xxxterm.h
+++ b/xxxterm.h
@@ -48,7 +48,6 @@ u_int32_t	arc4random_uniform(u_int32_t);
 #include <sys/tree.h>
 #endif
 #include <sys/queue.h>
-#include <sys/resource.h>
 #include <sys/socket.h>
 #include <sys/stat.h>
 #include <sys/time.h>
@@ -81,6 +80,11 @@ u_int32_t	arc4random_uniform(u_int32_t);
 #include <sys/wait.h>
 #endif
 
+/* set if you don't want to use resource limits */
+#ifndef XT_RESOURCE_LIMITS_DISABLE
+#include <sys/resource.h>
+#endif
+
 #include "javascript.h"
 /*
 javascript.h borrowed from vimprobable2 under the following license: