From aaa5e9d309f2654b2f84d090f768faeaa048c172 Mon Sep 17 00:00:00 2001 From: Peter Surda Date: Sat, 23 Sep 2017 18:25:41 +0200 Subject: [PATCH] Windows daemon mode workaround --- src/bitmessagemain.py | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/src/bitmessagemain.py b/src/bitmessagemain.py index 9182b4cb..b015d5bf 100755 --- a/src/bitmessagemain.py +++ b/src/bitmessagemain.py @@ -349,12 +349,13 @@ class Main: shared.thisapp.lockPid = None # indicate we're the final child sys.stdout.flush() sys.stderr.flush() - si = file(os.devnull, 'r') - so = file(os.devnull, 'a+') - se = file(os.devnull, 'a+', 0) - os.dup2(si.fileno(), sys.stdin.fileno()) - os.dup2(so.fileno(), sys.stdout.fileno()) - os.dup2(se.fileno(), sys.stderr.fileno()) + if not sys.platform.startswith('win'): + si = file(os.devnull, 'r') + so = file(os.devnull, 'a+') + se = file(os.devnull, 'a+', 0) + os.dup2(si.fileno(), sys.stdin.fileno()) + os.dup2(so.fileno(), sys.stdout.fileno()) + os.dup2(se.fileno(), sys.stderr.fileno()) def setSignalHandler(self): signal.signal(signal.SIGINT, helper_generic.signal_handler)