Commit b628191f authored by Guido Trotter's avatar Guido Trotter
Browse files

AsyncAwaker: use shutdown on the socketpair



This makes sure the out_socket can only be used for writing, and the
in_socket for reading.
Signed-off-by: default avatarGuido Trotter <ultrotter@google.com>
Reviewed-by: default avatarMichael Hanselmann <hansmi@google.com>
parent c2a8e8ba
......@@ -339,6 +339,8 @@ class AsyncAwaker(GanetiBaseAsyncoreDispatcher):
(self.in_socket, self.out_socket) = socket.socketpair(socket.AF_UNIX,
socket.SOCK_STREAM)
self.in_socket.setblocking(0)
self.in_socket.shutdown(socket.SHUT_WR)
self.out_socket.shutdown(socket.SHUT_RD)
self.set_socket(self.in_socket)
self.need_signal = True
self.signal_fn = signal_fn
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment