Ver código fonte

Make sure stdout is blocking for "darc serve".

Fixes ssh issue on CentOS
Jonas Borgström 13 anos atrás
pai
commit
d7e876557a
1 arquivos alterados com 3 adições e 0 exclusões
  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)