commit:     12c985f89515f17d59107c35d8e9c76f3735f80a
Author:     Brian Dolbec <dolsen <AT> gentoo <DOT> org>
AuthorDate: Mon Jan 14 03:32:29 2013 +0000
Commit:     Brian Dolbec <brian.dolbec <AT> gmail <DOT> com>
CommitDate: Mon Mar 24 16:07:08 2014 +0000
URL:        
http://git.overlays.gentoo.org/gitweb/?p=proj/catalyst.git;a=commit;h=12c985f8

Fix undefined variable: RLIMIT_NOFILE

It was not imported from resource, it was also not used correctly.

---
 modules/catalyst_support.py | 12 +++++++-----
 1 file changed, 7 insertions(+), 5 deletions(-)

diff --git a/modules/catalyst_support.py b/modules/catalyst_support.py
index 316dfa3..d493f88 100644
--- a/modules/catalyst_support.py
+++ b/modules/catalyst_support.py
@@ -6,14 +6,16 @@ selinux_capable = False
 #fakeroot_capable = False
 BASH_BINARY             = "/bin/bash"
 
+# set it to 0 for the soft limit, 1 for the hard limit
+DESIRED_RLIMIT = 0
 try:
-        import resource
-        max_fd_limit=resource.getrlimit(RLIMIT_NOFILE)
+       import resource
+       max_fd_limit=resource.getrlimit(resource.RLIMIT_NOFILE)[DESIRED_RLIMIT]
 except SystemExit, e:
-        raise
+       raise
 except:
-        # hokay, no resource module.
-        max_fd_limit=256
+       # hokay, no resource module.
+       max_fd_limit=256
 
 # pids this process knows of.
 spawned_pids = []

Reply via email to