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

Side by Side Diff: pym/_emerge/EbuildIpcDaemon.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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « bin/ebuild-ipc.py ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 # Copyright 2010 Gentoo Foundation 1 # Copyright 2010 Gentoo Foundation
2 # Distributed under the terms of the GNU General Public License v2 2 # Distributed under the terms of the GNU General Public License v2
3 3
4 import errno 4 import errno
5 import pickle 5 import pickle
6 from portage import os 6 from portage import os
7 from _emerge.FifoIpcDaemon import FifoIpcDaemon 7 from _emerge.FifoIpcDaemon import FifoIpcDaemon
8 from _emerge.PollConstants import PollConstants 8 from _emerge.PollConstants import PollConstants
9 9
10 class EbuildIpcDaemon(FifoIpcDaemon): 10 class EbuildIpcDaemon(FifoIpcDaemon):
(...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after
77 # ebuild process if it is waiting for a reply 77 # ebuild process if it is waiting for a reply
78 # when we try to kill the ebuild process. 78 # when we try to kill the ebuild process.
79 reply_hook = getattr(cmd_handler, 79 reply_hook = getattr(cmd_handler,
80 'reply_hook', None) 80 'reply_hook', None)
81 if reply_hook is not None: 81 if reply_hook is not None:
82 reply_hook() 82 reply_hook()
83 83
84 def _send_reply(self, reply): 84 def _send_reply(self, reply):
85 # File streams are in unbuffered mode since we do atomic 85 # File streams are in unbuffered mode since we do atomic
86 # read and write of whole pickles. 86 # read and write of whole pickles.
87 » » output_file = open(self.output_fifo, 'wb', 0) 87 » » output_file = os.open(self.output_fifo, os.O_WRONLY | os.O_NONBL OCK)
88 » » output_file.write(pickle.dumps(reply)) 88 » » os.write(output_file, pickle.dumps(reply))
89 » » output_file.close() 89 » » os.close(output_file)
OLDNEW
« no previous file with comments | « bin/ebuild-ipc.py ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698