From f584ad95048279b244083fee330c5741be2b9da7 Mon Sep 17 00:00:00 2001 From: NIIBE Yutaka Date: Thu, 31 Mar 2022 21:03:13 +0900 Subject: scd,tpm2d: Fix for consistent use of socket FD. * scd/command.c (scd_command_handler): Use gnupg_fd_t for the argument but no INT2FD to listen. Use GNUPG_INVALID_FD. * tpm2d/command.c (tpm2d_command_handler): Likewise. * scd/scdaemon.c (start_connection_thread): Follow the change. * tpm2d/tpm2daemon.c (start_connection_thread): Likewise. * scd/scdaemon.h (scd_command_handler): Use gnupg_fd_t. * tpm2d/tpm2daemon.h (tpm2d_command_handler): Likewise. -- Signed-off-by: NIIBE Yutaka --- scd/command.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'scd/command.c') diff --git a/scd/command.c b/scd/command.c index 10f5a2fe1..bc2e1f979 100644 --- a/scd/command.c +++ b/scd/command.c @@ -2454,7 +2454,7 @@ register_commands (assuan_context_t ctx) server, otherwise it is a regular server. Returns true if there are no more active asessions. */ int -scd_command_handler (ctrl_t ctrl, int fd) +scd_command_handler (ctrl_t ctrl, gnupg_fd_t fd) { int rc; assuan_context_t ctx = NULL; @@ -2468,7 +2468,7 @@ scd_command_handler (ctrl_t ctrl, int fd) scd_exit (2); } - if (fd == -1) + if (fd == GNUPG_INVALID_FD) { assuan_fd_t filedes[2]; @@ -2478,7 +2478,7 @@ scd_command_handler (ctrl_t ctrl, int fd) } else { - rc = assuan_init_socket_server (ctx, INT2FD(fd), + rc = assuan_init_socket_server (ctx, fd, ASSUAN_SOCKET_SERVER_ACCEPTED); } if (rc) -- cgit v1.2.3