aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorZac Medico <zmedico@gentoo.org>2012-03-27 11:28:12 -0700
committerZac Medico <zmedico@gentoo.org>2012-03-27 11:28:12 -0700
commit144c23efbb4e9565debad03c13c5bcab833a8336 (patch)
treeab9093b86335c68e8f425ceb56249b308bceb93a /pym/portage/dbapi
parentetc-update: handle emacs diff cmd, bug #409849 (diff)
downloadportage-144c23efbb4e9565debad03c13c5bcab833a8336.tar.gz
portage-144c23efbb4e9565debad03c13c5bcab833a8336.tar.bz2
portage-144c23efbb4e9565debad03c13c5bcab833a8336.zip
Close fewer file descriptors for fork / no exec.
This will fix bug #374335.
Diffstat (limited to 'pym/portage/dbapi')
-rw-r--r--pym/portage/dbapi/_MergeProcess.py13
1 files changed, 3 insertions, 10 deletions
diff --git a/pym/portage/dbapi/_MergeProcess.py b/pym/portage/dbapi/_MergeProcess.py
index 301625c81..b5f6a0b0b 100644
--- a/pym/portage/dbapi/_MergeProcess.py
+++ b/pym/portage/dbapi/_MergeProcess.py
@@ -2,7 +2,6 @@
# Distributed under the terms of the GNU General Public License v2
import io
-import platform
import signal
import sys
import traceback
@@ -155,15 +154,9 @@ class MergeProcess(SpawnProcess):
return [pid]
os.close(elog_reader_fd)
-
- # TODO: Find out why PyPy 1.8 with close_fds=True triggers
- # "[Errno 9] Bad file descriptor" in subprocesses. It could
- # be due to garbage collection of file objects that were not
- # closed before going out of scope, since PyPy's garbage
- # collector does not support the refcounting semantics that
- # CPython does.
- close_fds = platform.python_implementation() != 'PyPy'
- portage.process._setup_pipes(fd_pipes, close_fds=close_fds)
+ portage.locks._close_fds()
+ # Disable close_fds since we don't exec (see _setup_pipes docstring).
+ portage.process._setup_pipes(fd_pipes, close_fds=False)
# Use default signal handlers since the ones inherited
# from the parent process are irrelevant here.