import logging
import os
import pickle
-import select
import signal
import sys
import time
# File streams are in unbuffered mode since we do atomic
# read and write of whole pickles.
- 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:
self._no_daemon_msg()
return 2
- start_time = time.time()
- while True:
- events = select.select([input_file], [], [],
- self._COMMUNICATE_RETRY_TIMEOUT_SECONDS)
- if events[0]:
- break
- else:
- if self._daemon_is_alive():
- self._timeout_retry_msg(start_time,
- portage.localization._('during select'))
- else:
- self._no_daemon_msg()
- return 2
+ input_file = open(self.ipc_out_fifo, 'rb', 0)
start_time = time.time()
while True:
import errno
import pickle
-from portage import os
from _emerge.FifoIpcDaemon import FifoIpcDaemon
-from _emerge.PollConstants import PollConstants
class EbuildIpcDaemon(FifoIpcDaemon):
"""
reply_hook()
def _send_reply(self, reply):
- output_fd = os.open(self.output_fifo, os.O_WRONLY|os.O_NONBLOCK)
-
# File streams are in unbuffered mode since we do atomic
# read and write of whole pickles.
- output_file = os.fdopen(output_fd, 'wb', 0)
+ output_file = open(self.output_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(reply))
- output_file.flush()
output_file.close()