make socket uniqe

This commit is contained in:
chrys 2018-09-07 19:50:10 +02:00
parent 06e513a976
commit 14aadf6eda

View File

@ -62,7 +62,10 @@ class remoteManager():
# /run/user/<uid>/fenrirscreenreader/daemon # /run/user/<uid>/fenrirscreenreader/daemon
# socket pty # socket pty
# /run/user/<uid>/fenrirscreenreader/ptyX # /run/user/<uid>/fenrirscreenreader/ptyX
socketpath = '/tmp/fenrir-deamon.sock' if self.env['runtime']['settingsManager'].getSetting('screen', 'driver') =='vcsaDriver':
socketpath = '/tmp/fenrirscreenreader-deamon.sock'
else:
socketpath = '/tmp/fenrirscreenreader-' + str(os.getpid()) + '.sock'
if os.path.exists(socketpath): if os.path.exists(socketpath):
os.remove(socketpath) os.remove(socketpath)
self.sock = socket.socket(socket.AF_UNIX, socket.SOCK_STREAM) self.sock = socket.socket(socket.AF_UNIX, socket.SOCK_STREAM)