1
0
Fork 0
mirror of https://github.com/borgbackup/borg.git synced 2025-01-25 00:38:58 +00:00

Make sure stdout is blocking for "darc serve".

Fixes ssh issue on CentOS
This commit is contained in:
Jonas Borgström 2012-02-07 20:39:22 +01:00
parent c4e022a7fc
commit d7e876557a

View file

@ -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)