From f8b8b6aac2ca1cb34d7a346aee1d874e7650557b Mon Sep 17 00:00:00 2001 From: NIIBE Yutaka Date: Thu, 8 Mar 2018 16:51:51 +0900 Subject: scd: Fix status check when using PC/SC. * scd/apdu.c (struct reader_table_s): Add field of current_state. (new_reader_slot): Initialize current_state. (pcsc_get_status): Keep the status in READER_TABLE array. Return SW_HOST_NO_READER when PCSC_STATE_CHANGED. * scd/scdaemon.c (handle_connections): Silence a warning. -- To detect some change of card status, including suspend/resume possibly, SCardGetStatusChange should be used keeping the dwCurrentState field. This change could improve situation for suspend/resume with Yubikey on Windows. Even not, this is doing the Right Thing. Signed-off-by: NIIBE Yutaka --- scd/scdaemon.c | 2 ++ 1 file changed, 2 insertions(+) (limited to 'scd/scdaemon.c') diff --git a/scd/scdaemon.c b/scd/scdaemon.c index cebeea9d3..91b559925 100644 --- a/scd/scdaemon.c +++ b/scd/scdaemon.c @@ -1348,6 +1348,8 @@ handle_connections (int listen_fd) FD_SET (pipe_fd[0], &read_fdset); if (max_fd < pipe_fd[0]) max_fd = pipe_fd[0]; +#else + (void)max_fd; #endif #ifndef HAVE_W32_SYSTEM -- cgit v1.2.3