Gentoo Archives: gentoo-catalyst

From: Brian Dolbec <dolsen@g.o>
To: gentoo-catalyst@l.g.o
Subject: [gentoo-catalyst] [patch] Fix undefined variable: RLIMIT_NOFILE
Date: Wed, 27 Feb 2013 09:26:00
Message-Id: 1361957136.20292.15.camel@big_daddy.dol-sen.ca
1 will need to be applied to master manually.
2
3 ================================================
4
5 diff --git a/catalyst/support.py b/catalyst/support.py
6 index 2133799..072b985 100644
7 @@ -6,14 +6,16 @@ selinux_capable = False
8 #fakeroot_capable = False
9 BASH_BINARY = "/bin/bash"
10
11 +# set it to 0 for the soft limit, 1 for the hard limit
12 +DESIRED_RLIMIT = 0
13 try:
14 - import resource
15 - max_fd_limit=resource.getrlimit(RLIMIT_NOFILE)
16 + import resource
17 +
18 max_fd_limit=resource.getrlimit(resource.RLIMIT_NOFILE)[DESIRED_RLIMIT]
19 except SystemExit, e:
20 - raise
21 + raise
22 except:
23 - # hokay, no resource module.
24 - max_fd_limit=256
25 + # hokay, no resource module.
26 + max_fd_limit=256
27
28 # pids this process knows of.
29 spawned_pids = []
30
31
32 --
33 Brian Dolbec <dolsen@g.o>