From: Brian Dolbec Date: Mon, 14 Jan 2013 03:32:29 +0000 (-0800) Subject: Fix undefined variable: RLIMIT_NOFILE X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=380085b1b64a80cd6fc8518309e8ca9e31246ba3;p=catalyst.git Fix undefined variable: RLIMIT_NOFILE It was not imported from resource, it was also not used correctly. --- diff --git a/catalyst/support.py b/catalyst/support.py index e25394eb..5abf614f 100644 --- a/catalyst/support.py +++ b/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 = []