OLD | NEW |
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 Loading... |
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) |
OLD | NEW |