summaryrefslogtreecommitdiffstats
path: root/bin/ebuild-ipc.py
diff options
context:
space:
mode:
authorZac Medico <zmedico@gentoo.org>2010-09-14 15:53:39 -0700
committerZac Medico <zmedico@gentoo.org>2010-09-14 15:53:39 -0700
commit832c4045ab5c6d7fd118dabb9993d36301175ba0 (patch)
treea9dd6b90240cb3b5d304965c22976ddb43b8b204 /bin/ebuild-ipc.py
parentc8d1bcd28c29802dc2bc1f7ac9d6df475ff4700d (diff)
downloadportage-832c4045ab5c6d7fd118dabb9993d36301175ba0.tar.gz
portage-832c4045ab5c6d7fd118dabb9993d36301175ba0.tar.bz2
portage-832c4045ab5c6d7fd118dabb9993d36301175ba0.zip
Make ebuild-ipc.py close the output_file before trying to re-open it
after it has timed out.
Diffstat (limited to 'bin/ebuild-ipc.py')
-rwxr-xr-xbin/ebuild-ipc.py8
1 files changed, 6 insertions, 2 deletions
diff --git a/bin/ebuild-ipc.py b/bin/ebuild-ipc.py
index 20410eb85..2d524a752 100755
--- a/bin/ebuild-ipc.py
+++ b/bin/ebuild-ipc.py
@@ -94,6 +94,7 @@ class EbuildIpc(object):
input_fd = os.open(self.ipc_out_fifo,
os.O_RDONLY|os.O_NONBLOCK)
input_file = os.fdopen(input_fd, 'rb', 0)
+ output_file = None
while True:
try:
@@ -101,13 +102,17 @@ class EbuildIpc(object):
portage.exception.AlarmSignal.register(
self._COMMUNICATE_RETRY_TIMEOUT_SECONDS)
+ if output_file is not None:
+ output_file.close()
+ output_file = None
+
output_file = open(self.ipc_in_fifo, 'wb', 0)
# Write the whole pickle in a single atomic write() call,
# since the reader is in non-blocking mode and we want
# it to get the whole pickle at once.
output_file.write(pickle.dumps(args))
- output_file.flush()
+ output_file.close()
break
finally:
portage.exception.AlarmSignal.unregister()
@@ -172,7 +177,6 @@ class EbuildIpc(object):
level=logging.ERROR, noiselevel=-1)
else:
- output_file.close()
input_file.close()
(out, err, rval) = reply