浏览代码

Make sure stdout is blocking for "darc serve".

Fixes ssh issue on CentOS
Jonas Borgström 13 年之前
父节点
当前提交
d7e876557a
共有 1 个文件被更改,包括 3 次插入0 次删除
  1. 3 0
      darc/remote.py

+ 3 - 0
darc/remote.py

@@ -38,6 +38,9 @@ class StoreServer(object):
         # 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)