diff options
| author | Timo Weingärtner <timo@tiwe.de> | 2021-04-29 17:28:15 +0200 |
|---|---|---|
| committer | Timo Weingärtner <timo@tiwe.de> | 2026-03-07 18:51:10 +0100 |
| commit | df63d26366b39ad8eb1c1ba5876b57b6a15208ed (patch) | |
| tree | e052924cc391941a5d8d018249b1a7541d1acb39 | |
| parent | d17162f5c6f7d002bf68fac48bcadd2db0c033e7 (diff) | |
| download | ssh-agent-filter-df63d26366b39ad8eb1c1ba5876b57b6a15208ed.tar.gz | |
use C++17 constructor template argument deduction (CTAD)
| -rw-r--r-- | ssh-agent-filter.C | 12 |
1 files changed, 5 insertions, 7 deletions
diff --git a/ssh-agent-filter.C b/ssh-agent-filter.C index c513804..639e55c 100644 --- a/ssh-agent-filter.C +++ b/ssh-agent-filter.C @@ -61,8 +61,6 @@ using std::pair; #include <thread> #include <mutex> -using std::mutex; -using std::lock_guard; #include <optional> @@ -103,7 +101,7 @@ bool debug{false}; bool all_confirmed{false}; string saf_name; fs::path path; -mutex fd_fork_mutex; +std::mutex fd_fork_mutex; string md5_hex (string const & s) { @@ -141,7 +139,7 @@ int make_upstream_agent_conn () { throw invalid_argument("no $SSH_AUTH_SOCK"); { - lock_guard<mutex> lock{fd_fork_mutex}; + std::lock_guard lock{fd_fork_mutex}; if ((sock = socket(AF_UNIX, SOCK_STREAM | SOCK_CLOEXEC, 0)) == -1) throw system_error(errno, system_category(), "socket"); cloexec(sock); @@ -165,7 +163,7 @@ int make_listen_sock () { struct sockaddr_un addr; { - lock_guard<mutex> lock{fd_fork_mutex}; + std::lock_guard lock{fd_fork_mutex}; if ((sock = socket(AF_UNIX, SOCK_STREAM | SOCK_CLOEXEC, 0)) == -1) throw system_error(errno, system_category(), "socket"); cloexec(sock); @@ -310,7 +308,7 @@ bool confirm (string const & question) { sap = "ssh-askpass"; pid_t pid; { - lock_guard<mutex> lock{fd_fork_mutex}; + std::lock_guard lock{fd_fork_mutex}; pid = fork(); } if (pid < 0) @@ -636,7 +634,7 @@ int main (int const argc, char const * const * const argv) { select(listen_sock + 1, &fds, nullptr, nullptr, nullptr); int client_sock; { - lock_guard<mutex> lock{fd_fork_mutex}; + std::lock_guard lock{fd_fork_mutex}; if ((client_sock = accept(listen_sock, nullptr, nullptr)) == -1) { if (errno == EAGAIN || errno == EWOULDBLOCK) continue; |
