now now exit if display daemin dies

This commit is contained in:
Florian Streibelt 2011-10-15 02:21:32 +02:00
parent 5124cf1d23
commit 15493ee6aa
1 changed files with 7 additions and 3 deletions

View File

@ -37,7 +37,6 @@ def print_display(s):
global display_fifo global display_fifo
if not display_fifo: if not display_fifo:
try: try:
#display_fifo = open('/tmp/display', 'w')
fd = os.open( "/tmp/display", os.O_WRONLY) fd = os.open( "/tmp/display", os.O_WRONLY)
display_fifo = os.fdopen(fd,"w") display_fifo = os.fdopen(fd,"w")
except OSError: except OSError:
@ -48,8 +47,13 @@ def print_display(s):
display_fifo = None display_fifo = None
pass pass
return return
display_fifo.write(s) try:
display_fifo.flush() display_fifo.write(s)
display_fifo.flush()
except IOError:
display_fifo = None
pass
return
def clear(): def clear():