summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authormathieui <mathieui@mathieui.net>2014-04-19 06:36:10 +0200
committermathieui <mathieui@mathieui.net>2014-04-19 06:36:10 +0200
commit3622443631bbb901baaa75552e2021ae0b2798e6 (patch)
tree8ebec33d2892952287882d940137cec92c67db85 /src
parent04010298549669cd92adee02d71dc434689342b4 (diff)
downloadpoezio-3622443631bbb901baaa75552e2021ae0b2798e6.tar.gz
poezio-3622443631bbb901baaa75552e2021ae0b2798e6.tar.bz2
poezio-3622443631bbb901baaa75552e2021ae0b2798e6.tar.xz
poezio-3622443631bbb901baaa75552e2021ae0b2798e6.zip
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
Diffstat (limited to 'src')
-rw-r--r--src/fifo.py3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/fifo.py b/src/fifo.py
index 7db4b160..983b21e4 100644
--- a/src/fifo.py
+++ b/src/fifo.py
@@ -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):