From d7e876557ab67ed4f1dab921eb91a2d14846c1d4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jonas=20Borgstr=C3=B6m?= Date: Tue, 7 Feb 2012 20:39:22 +0100 Subject: [PATCH] Make sure stdout is blocking for "darc serve". Fixes ssh issue on CentOS --- darc/remote.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/darc/remote.py b/darc/remote.py index 969cb57cd..1689acdaf 100644 --- a/darc/remote.py +++ b/darc/remote.py @@ -38,6 +38,9 @@ def serve(self): # Make stdin non-blocking fl = fcntl.fcntl(sys.stdin.fileno(), fcntl.F_GETFL) fcntl.fcntl(sys.stdin.fileno(), fcntl.F_SETFL, fl | os.O_NONBLOCK) + # Make stdout blocking + fl = fcntl.fcntl(sys.stdout.fileno(), fcntl.F_GETFL) + fcntl.fcntl(sys.stdout.fileno(), fcntl.F_SETFL, fl & ~os.O_NONBLOCK) unpacker = msgpack.Unpacker() while True: r, w, es = select.select([sys.stdin], [], [], 10)