SpawnProcess: enable FD_CLOEXEC for Darwin
authorZac Medico <zmedico@gentoo.org>
Wed, 18 Sep 2013 18:29:27 +0000 (11:29 -0700)
committerZac Medico <zmedico@gentoo.org>
Wed, 18 Sep 2013 18:29:27 +0000 (11:29 -0700)
Bug #456296 is now handled by the F_GETFD/F_SETFD commands in commit
30c652a9db1014fc720f7d6055520a07b731c984.

pym/_emerge/SpawnProcess.py

index b36d15f692e08fc1e4fd9c8165628e21b5217949..15d3dc5cfeb02e87f4c1acf12b050318720982c8 100644 (file)
@@ -9,7 +9,6 @@ except ImportError:
 
 import errno
 import logging
-import platform
 import signal
 import sys
 
@@ -20,11 +19,6 @@ from portage.const import BASH_BINARY
 from portage.util import writemsg_level
 from portage.util._async.PipeLogger import PipeLogger
 
-# On Darwin, FD_CLOEXEC triggers errno 35 for stdout (bug #456296)
-# TODO: Test this again now that it's been fixed to use
-# F_GETFD/F_SETFD instead of F_GETFL/F_SETFL.
-_disable_cloexec_stdout = platform.system() in ("Darwin",)
-
 class SpawnProcess(SubProcess):
 
        """
@@ -128,7 +122,7 @@ class SpawnProcess(SubProcess):
                if can_log and not self.background:
                        stdout_fd = os.dup(fd_pipes_orig[1])
                        # FD_CLOEXEC is enabled by default in Python >=3.4.
-                       if sys.hexversion < 0x3040000 and fcntl is not None and not _disable_cloexec_stdout:
+                       if sys.hexversion < 0x3040000 and fcntl is not None:
                                try:
                                        fcntl.FD_CLOEXEC
                                except AttributeError: