Keep a file descriptor reading the fifo instead of just opening and closing it

should take care of the sigpipe when no one is reading it anymore due to
broken connection
This commit is contained in:
mathieui 2014-04-19 06:36:10 +02:00
parent 0401029854
commit 3622443631

View file

@ -30,9 +30,10 @@ class OpenTrick(threading.Thread):
def __init__(self, path):
threading.Thread.__init__(self)
self.path = path
self.fd = None
def run(self):
open(self.path, 'r', encoding='utf-8').close()
self.fd = open(self.path, 'r', encoding='utf-8')
class Fifo(object):