summaryrefslogtreecommitdiffstats
path: root/bin/ebuild-ipc.py
diff options
context:
space:
mode:
authorZac Medico <zmedico@gentoo.org>2010-09-20 19:15:36 -0700
committerZac Medico <zmedico@gentoo.org>2010-09-20 19:15:36 -0700
commitf030e15e82c569a5268618c3b0a7e02566b93e4e (patch)
tree4b8b4252aef9294087275189fb46464ffab7a3f6 /bin/ebuild-ipc.py
parent33f4119d027691349166b0e4c9441a62be941909 (diff)
downloadportage-f030e15e82c569a5268618c3b0a7e02566b93e4e.tar.gz
portage-f030e15e82c569a5268618c3b0a7e02566b93e4e.tar.bz2
portage-f030e15e82c569a5268618c3b0a7e02566b93e4e.zip
Make ebuild-ipc use a normal read() call instead of array.fromfile()
since that should work fine for blocking IO.
Diffstat (limited to 'bin/ebuild-ipc.py')
-rwxr-xr-xbin/ebuild-ipc.py16
1 files changed, 3 insertions, 13 deletions
diff --git a/bin/ebuild-ipc.py b/bin/ebuild-ipc.py
index af152e11e..93991d87a 100755
--- a/bin/ebuild-ipc.py
+++ b/bin/ebuild-ipc.py
@@ -5,7 +5,6 @@
# This is a helper which ebuild processes can use
# to communicate with portage's main python process.
-import array
import logging
import os
import pickle
@@ -36,7 +35,6 @@ class EbuildIpc(object):
# Timeout for each individual communication attempt (we retry
# as long as the daemon process appears to be alive).
_COMMUNICATE_RETRY_TIMEOUT_SECONDS = 15
- _BUFSIZE = 4096
def __init__(self):
self.fifo_dir = os.environ['PORTAGE_BUILDDIR']
@@ -136,19 +134,11 @@ class EbuildIpc(object):
# File streams are in unbuffered mode since we do atomic
# read and write of whole pickles.
input_file = open(self.ipc_out_fifo, 'rb', 0)
- buf = array.array('B')
-
- try:
- buf.fromfile(input_file, self._BUFSIZE)
- except (EOFError, IOError) as e:
- if not buf:
- portage.util.writemsg_level(
- "ebuild-ipc: %s\n" % (e,),
- level=logging.ERROR, noiselevel=-1)
+ data = input_file.read()
retval = 2
- if not buf:
+ if not data:
portage.util.writemsg_level(
"ebuild-ipc: %s\n" % \
@@ -158,7 +148,7 @@ class EbuildIpc(object):
else:
try:
- reply = pickle.loads(buf.tostring())
+ reply = pickle.loads(data)
except SystemExit:
raise
except Exception as e: