Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(277)

Unified Diff: bin/ebuild-ipc.py

Issue 6713003: Update EbuildIpcDaemon to open files as non-blocking. (Closed) Base URL: http://git.chromium.org/git/portage_tool.git@cros-2.1.9
Patch Set: Created 9 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | pym/_emerge/EbuildIpcDaemon.py » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: bin/ebuild-ipc.py
diff --git a/bin/ebuild-ipc.py b/bin/ebuild-ipc.py
index d8e7e55129c24cb2899891ac312dc046adee26bf..84e7f3ba7c1135da0b8b6dadbb527530d731aaae 100755
--- a/bin/ebuild-ipc.py
+++ b/bin/ebuild-ipc.py
@@ -134,11 +134,7 @@ class EbuildIpc(object):
return os.WEXITSTATUS(wait_retval[1])
- def _receive_reply(self):
-
- # 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)
+ def _receive_reply(self, input_file):
# For maximum portability, use a single atomic read.
buf = None
@@ -192,6 +188,10 @@ class EbuildIpc(object):
self._no_daemon_msg()
return 2
+ # 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)
+
# Use forks so that the child process can handle blocking IO
# un-interrupted, while the parent handles all timeout
# considerations. This helps to avoid possible race conditions
@@ -231,7 +231,7 @@ class EbuildIpc(object):
if pid == 0:
os.close(pr)
- retval = self._receive_reply()
+ retval = self._receive_reply(input_file)
os._exit(retval)
os.close(pw)
« no previous file with comments | « no previous file | pym/_emerge/EbuildIpcDaemon.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698