From 8f60c1777e98c70e954bf1fac9b700f659ed5b1a Mon Sep 17 00:00:00 2001 From: chrys87 Date: Tue, 25 Jul 2017 09:54:03 +0200 Subject: [PATCH] Update vcsaDriver.py --- src/fenrir/screenDriver/vcsaDriver.py | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/src/fenrir/screenDriver/vcsaDriver.py b/src/fenrir/screenDriver/vcsaDriver.py index c0fc4071..c98264a3 100644 --- a/src/fenrir/screenDriver/vcsaDriver.py +++ b/src/fenrir/screenDriver/vcsaDriver.py @@ -165,7 +165,12 @@ class driver(): self.env['runtime']['debug'].writeDebugOut('VCSA:updateWatchdog:' + str(e),debug.debugLevel.ERROR) def updateCharMap(self, screen): - tty = open('/dev/tty' + screen, 'rb') + self.charmap = {} + try: + tty = open('/dev/tty' + screen, 'rb') + except Exception as e: + self.env['runtime']['debug'].writeDebugOut('VCSA:updateCharMap:' + str(e),debug.debugLevel.ERROR) + return GIO_UNIMAP = 0x4B66 VT_GETHIFONTMASK = 0x560D himask = array("H", (0,)) @@ -179,9 +184,10 @@ class driver(): unimapdesc = array("B", pack("@HP", sz, unipairs.buffer_info()[0])) ioctl(tty.fileno(), GIO_UNIMAP, unimapdesc) break - except IOError as e: - if e.errno != errno.ENOMEM: - raise + except Exception as e: + tty.close() + self.env['runtime']['debug'].writeDebugOut('VCSA:updateCharMap:' + str(e),debug.debugLevel.ERROR) + return sz *= 2 tty.close() ncodes, = unpack_from("@H", unimapdesc)