Gentoo Archives: gentoo-commits

From: Brian Dolbec <brian.dolbec@×××××.com>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] proj/catalyst:2.X commit in: modules/
Date: Mon, 24 Mar 2014 16:08:19
Message-Id: 1395677228.12c985f89515f17d59107c35d8e9c76f3735f80a.dol-sen@gentoo
1 commit: 12c985f89515f17d59107c35d8e9c76f3735f80a
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: Mon Mar 24 16:07:08 2014 +0000
6 URL: http://git.overlays.gentoo.org/gitweb/?p=proj/catalyst.git;a=commit;h=12c985f8
7
8 Fix undefined variable: RLIMIT_NOFILE
9
10 It was not imported from resource, it was also not used correctly.
11
12 ---
13 modules/catalyst_support.py | 12 +++++++-----
14 1 file changed, 7 insertions(+), 5 deletions(-)
15
16 diff --git a/modules/catalyst_support.py b/modules/catalyst_support.py
17 index 316dfa3..d493f88 100644
18 --- a/modules/catalyst_support.py
19 +++ b/modules/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 = []