aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ssh-agent-filter.C3
1 files changed, 3 insertions, 0 deletions
diff --git a/ssh-agent-filter.C b/ssh-agent-filter.C
index 1dcbb5c..30aaf9a 100644
--- a/ssh-agent-filter.C
+++ b/ssh-agent-filter.C
@@ -497,6 +497,9 @@ rfc4251::string handle_request (rfc4251::string const & r) {
}
void handle_client (int const sock) try {
+ if (fcntl(sock, F_SETFL, fcntl(sock, F_GETFL) & ~O_NONBLOCK))
+ throw system_error(errno, system_category(), "fcntl");
+
io::stream<io::file_descriptor> client{sock, io::close_handle};
arm(client);