From 1eaf915e8ea5bfebf7a426bb5b6fdcd15978cae1 Mon Sep 17 00:00:00 2001 From: NIIBE Yutaka Date: Mon, 24 Jul 2023 13:52:22 +0900 Subject: [PATCH] agent,dirmngr,kbx,scdaemon: Use assuan_sock_accept. * agent/gpg-agent.c (handle_connections): Use assuan_sock_accept. * dirmngr/dirmngr.c (handle_connections): Ditto. * kbx/keyboxd.c (handle_connections): Ditto. * scd/scdaemon.c (handle_connections): Ditto. * tpm2d/tpm2daemon.c (handle_connections): Ditto. -- GnuPG-bug-id: 6599 Signed-off-by: NIIBE Yutaka --- agent/gpg-agent.c | 4 ++-- dirmngr/dirmngr.c | 4 ++-- kbx/keyboxd.c | 4 ++-- scd/scdaemon.c | 4 ++-- tpm2d/tpm2daemon.c | 4 ++-- 5 files changed, 10 insertions(+), 10 deletions(-) diff --git a/agent/gpg-agent.c b/agent/gpg-agent.c index 335d389c6..624d2972c 100644 --- a/agent/gpg-agent.c +++ b/agent/gpg-agent.c @@ -3222,8 +3222,8 @@ handle_connections (gnupg_fd_t listen_fd, continue; plen = sizeof paddr; - fd = INT2FD (npth_accept (FD2INT(listentbl[idx].l_fd), - (struct sockaddr *)&paddr, &plen)); + fd = assuan_sock_accept (listentbl[idx].l_fd, + (struct sockaddr *)&paddr, &plen); if (fd == GNUPG_INVALID_FD) { log_error ("accept failed for %s: %s\n", diff --git a/dirmngr/dirmngr.c b/dirmngr/dirmngr.c index 9528ba91b..967281ede 100644 --- a/dirmngr/dirmngr.c +++ b/dirmngr/dirmngr.c @@ -2483,8 +2483,8 @@ handle_connections (assuan_fd_t listen_fd) gnupg_fd_t fd; plen = sizeof paddr; - fd = INT2FD (npth_accept (FD2INT(listen_fd), - (struct sockaddr *)&paddr, &plen)); + fd = assuan_sock_accept (listen_fd, + (struct sockaddr *)&paddr, &plen); if (fd == GNUPG_INVALID_FD) { log_error ("accept failed: %s\n", strerror (errno)); diff --git a/kbx/keyboxd.c b/kbx/keyboxd.c index bfb0c653d..c33d85518 100644 --- a/kbx/keyboxd.c +++ b/kbx/keyboxd.c @@ -1652,8 +1652,8 @@ handle_connections (gnupg_fd_t listen_fd) continue; plen = sizeof paddr; - fd = INT2FD (npth_accept (FD2INT(listentbl[idx].l_fd), - (struct sockaddr *)&paddr, &plen)); + fd = assuan_sock_accept (listentbl[idx].l_fd, + (struct sockaddr *)&paddr, &plen); if (fd == GNUPG_INVALID_FD) { log_error ("accept failed for %s: %s\n", diff --git a/scd/scdaemon.c b/scd/scdaemon.c index 653fc78cc..71e37d28c 100644 --- a/scd/scdaemon.c +++ b/scd/scdaemon.c @@ -1399,8 +1399,8 @@ handle_connections (gnupg_fd_t listen_fd) gnupg_fd_t fd; plen = sizeof paddr; - fd = INT2FD (npth_accept (FD2INT (listen_fd), - (struct sockaddr *)&paddr, &plen)); + fd = assuan_sock_accept (listen_fd, + (struct sockaddr *)&paddr, &plen); if (fd == GNUPG_INVALID_FD) { log_error ("accept failed: %s\n", strerror (errno)); diff --git a/tpm2d/tpm2daemon.c b/tpm2d/tpm2daemon.c index 383421c30..9218d9a10 100644 --- a/tpm2d/tpm2daemon.c +++ b/tpm2d/tpm2daemon.c @@ -1238,8 +1238,8 @@ handle_connections (gnupg_fd_t listen_fd) gnupg_fd_t fd; plen = sizeof paddr; - fd = INT2FD (npth_accept (FD2INT (listen_fd), - (struct sockaddr *)&paddr, &plen)); + fd = assuan_sock_accept (listen_fd, + (struct sockaddr *)&paddr, &plen); if (fd == GNUPG_INVALID_FD) { log_error ("accept failed: %s\n", strerror (errno));