1 |
commit: 0153ca58ca0121ed1d35e5d1b9836f6e732956c5 |
2 |
Author: Brian Dolbec <dolsen <AT> gentoo <DOT> org> |
3 |
AuthorDate: Mon Jan 14 03:32:29 2013 +0000 |
4 |
Commit: Brian Dolbec <brian.dolbec <AT> gmail <DOT> com> |
5 |
CommitDate: Sat Mar 22 18:01:30 2014 +0000 |
6 |
URL: http://git.overlays.gentoo.org/gitweb/?p=proj/catalyst.git;a=commit;h=0153ca58 |
7 |
|
8 |
Fix undefined variable: RLIMIT_NOFILE |
9 |
|
10 |
It was not imported from resource, it was also not used correctly. |
11 |
|
12 |
--- |
13 |
catalyst/support.py | 12 +++++++----- |
14 |
1 file changed, 7 insertions(+), 5 deletions(-) |
15 |
|
16 |
diff --git a/catalyst/support.py b/catalyst/support.py |
17 |
index e25394e..5abf614 100644 |
18 |
--- a/catalyst/support.py |
19 |
+++ b/catalyst/support.py |
20 |
@@ -6,14 +6,16 @@ selinux_capable = False |
21 |
#fakeroot_capable = False |
22 |
BASH_BINARY = "/bin/bash" |
23 |
|
24 |
+# set it to 0 for the soft limit, 1 for the hard limit |
25 |
+DESIRED_RLIMIT = 0 |
26 |
try: |
27 |
- import resource |
28 |
- max_fd_limit=resource.getrlimit(RLIMIT_NOFILE) |
29 |
+ import resource |
30 |
+ max_fd_limit=resource.getrlimit(resource.RLIMIT_NOFILE)[DESIRED_RLIMIT] |
31 |
except SystemExit, e: |
32 |
- raise |
33 |
+ raise |
34 |
except: |
35 |
- # hokay, no resource module. |
36 |
- max_fd_limit=256 |
37 |
+ # hokay, no resource module. |
38 |
+ max_fd_limit=256 |
39 |
|
40 |
# pids this process knows of. |
41 |
spawned_pids = [] |