aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ssh-agent-filter.C12
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;