From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from lists.gentoo.org (pigeon.gentoo.org [208.92.234.80]) by finch.gentoo.org (Postfix) with ESMTP id CFFD31387FD for ; Wed, 2 Apr 2014 20:30:16 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 8CD7AE0E47; Wed, 2 Apr 2014 20:30:13 +0000 (UTC) Received: from smtp.gentoo.org (smtp.gentoo.org [140.211.166.183]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by pigeon.gentoo.org (Postfix) with ESMTPS id D2B84E0E47 for ; Wed, 2 Apr 2014 20:30:12 +0000 (UTC) Received: from big_daddy.dol-sen.ca (S010600222de111ff.vc.shawcable.net [96.49.5.156]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) (Authenticated sender: dolsen) by smtp.gentoo.org (Postfix) with ESMTPSA id EE97F33FB37 for ; Wed, 2 Apr 2014 20:30:11 +0000 (UTC) From: Brian Dolbec To: gentoo-catalyst@lists.gentoo.org Subject: [gentoo-catalyst] [PATCH 4/8] Fix undefined variable: RLIMIT_NOFILE Date: Wed, 2 Apr 2014 13:29:39 -0700 Message-Id: <1396470583-8756-4-git-send-email-dolsen@gentoo.org> X-Mailer: git-send-email 1.8.5.3 In-Reply-To: <1396470583-8756-2-git-send-email-dolsen@gentoo.org> References: <1396470583-8756-2-git-send-email-dolsen@gentoo.org> Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-catalyst@lists.gentoo.org Reply-to: gentoo-catalyst@lists.gentoo.org X-Archives-Salt: 58e76643-45d6-4835-b97a-fe89303c495e X-Archives-Hash: 2c8699629580dea9ee34e2db4b08f35e It was not imported from resource, it was also not used correctly. --- catalyst/support.py | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/catalyst/support.py b/catalyst/support.py index e25394e..5abf614 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 = [] -- 1.8.5.3