From f611240fba714b676e7a676cbdbbca3e32c5c14d Mon Sep 17 00:00:00 2001 From: Jakub Jelen Date: Mon, 23 Aug 2021 15:29:28 +0200 Subject: [PATCH 1/2] vpcd: Initialize variables This caused OpenSC CI failing as described in https://github.com/OpenSC/OpenSC/issues/2390 Authored by Doug Engert --- virtualsmartcard/src/vpcd/vpcd.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/virtualsmartcard/src/vpcd/vpcd.c b/virtualsmartcard/src/vpcd/vpcd.c index 8d3be0d..57fd55b 100644 --- a/virtualsmartcard/src/vpcd/vpcd.c +++ b/virtualsmartcard/src/vpcd/vpcd.c @@ -197,6 +197,8 @@ SOCKET waitforclient(SOCKET server, long secs, long usecs) struct pollfd pfd; pfd.fd = server; + pfd.events = POLLIN; + pfd.revents = 0; timeout = (secs * 1000000 + usecs / 1000); From 8d34ee42c733695683c3015530fb3d8791860e6b Mon Sep 17 00:00:00 2001 From: Jakub Jelen Date: Mon, 23 Aug 2021 15:31:03 +0200 Subject: [PATCH 2/2] vpcd: Fix timeout calculation Authored by Doug Engert --- virtualsmartcard/src/vpcd/vpcd.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/virtualsmartcard/src/vpcd/vpcd.c b/virtualsmartcard/src/vpcd/vpcd.c index 57fd55b..ee9e981 100644 --- a/virtualsmartcard/src/vpcd/vpcd.c +++ b/virtualsmartcard/src/vpcd/vpcd.c @@ -200,7 +200,7 @@ SOCKET waitforclient(SOCKET server, long secs, long usecs) pfd.events = POLLIN; pfd.revents = 0; - timeout = (secs * 1000000 + usecs / 1000); + timeout = (secs * 1000 + usecs / 1000); if (poll(&pfd, 1, timeout) == -1) return INVALID_SOCKET;