Gentoo Archives: gentoo-commits

From: Brian Dolbec <brian.dolbec@×××××.com>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] proj/catalyst:master commit in: catalyst/
Date: Mon, 05 May 2014 19:17:46
Message-Id: 1396469063.380085b1b64a80cd6fc8518309e8ca9e31246ba3.dol-sen@gentoo
1 commit: 380085b1b64a80cd6fc8518309e8ca9e31246ba3
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: Wed Apr 2 20:04:23 2014 +0000
6 URL: http://git.overlays.gentoo.org/gitweb/?p=proj/catalyst.git;a=commit;h=380085b1
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 = []