From adbbb81f7a82829363b41f6de8fc403caece3f33 Mon Sep 17 00:00:00 2001 From: Timo Weingärtner Date: Mon, 17 May 2021 13:10:24 +0200 Subject: add SOCK_NONBLOCK on listen socket creation to possibly save a syscall --- ssh-agent-filter.C | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/ssh-agent-filter.C b/ssh-agent-filter.C index 61255a0..cadfd1d 100644 --- a/ssh-agent-filter.C +++ b/ssh-agent-filter.C @@ -88,6 +88,9 @@ using std::pair; #ifndef SOCK_CLOEXEC #define SOCK_CLOEXEC 0 #endif +#ifndef SOCK_NONBLOCK +#define SOCK_NONBLOCK 0 +#endif vector allowed_b64; vector allowed_md5; @@ -172,7 +175,7 @@ int make_upstream_agent_conn () { } int make_listen_sock () { - int const sock = make_cloexec_socket(AF_UNIX, SOCK_STREAM, 0); + int const sock = make_cloexec_socket(AF_UNIX, SOCK_STREAM | SOCK_NONBLOCK, 0); alter_fd_flags(sock); -- cgit v1.2.3