about summary refs log tree commit diff stats
diff options
context:
space:
mode:
authorMarco Peereboom <marco@conformal.com>2012-01-23 12:43:13 -0600
committerMarco Peereboom <marco@conformal.com>2012-01-23 12:43:13 -0600
commit969d1e481e98dcee162221752f3daff2c09305d0 (patch)
tree88bbe005b74aeb2412386898e2f847af801109c1
parentb555ab78b18822af9e1b491c4bb7775a02b2c2ab (diff)
downloadxombrero-969d1e481e98dcee162221752f3daff2c09305d0.tar.gz
make resource limits use a #define block too
-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: