From a3797a63a30579be3ba5418aad7e76fd520f9aee Mon Sep 17 00:00:00 2001 From: Zac Medico Date: Tue, 13 Dec 2011 09:27:38 -0800 Subject: AbstractEbuildProcess: null in if not interactive --- pym/_emerge/AbstractEbuildProcess.py | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) (limited to 'pym') diff --git a/pym/_emerge/AbstractEbuildProcess.py b/pym/_emerge/AbstractEbuildProcess.py index 4147ecb7b..6e1491bbe 100644 --- a/pym/_emerge/AbstractEbuildProcess.py +++ b/pym/_emerge/AbstractEbuildProcess.py @@ -92,7 +92,19 @@ class AbstractEbuildProcess(SpawnProcess): else: self.settings.pop('PORTAGE_EBUILD_EXIT_FILE', None) - SpawnProcess._start(self) + if self.fd_pipes is None: + self.fd_pipes = {} + null_fd = None + if 0 not in self.fd_pipes and \ + "interactive" not in self.settings.get("PROPERTIES", "").split(): + null_fd = os.open('/dev/null', os.O_RDONLY) + self.fd_pipes[0] = null_fd + + try: + SpawnProcess._start(self) + finally: + if null_fd is not None: + os.close(null_fd) def _init_ipc_fifos(self): -- cgit v1.2.3-1-g7c22