From e02880d5126fdb96710170632f8f2564d14242fd Mon Sep 17 00:00:00 2001 From: NIIBE Yutaka Date: Thu, 6 Jun 2024 08:56:27 +0900 Subject: [PATCH] common:w32: Fix for 64-bit Windows. * common/exectool.c (gnupg_exec_tool_stream): 64-bit Windows is LLP64. -- GnuPG-bug-id: 7139 Signed-off-by: NIIBE Yutaka --- common/exectool.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/common/exectool.c b/common/exectool.c index d8326e77b..ce424fc49 100644 --- a/common/exectool.c +++ b/common/exectool.c @@ -407,8 +407,13 @@ gnupg_exec_tool_stream (const char *pgmname, const char *argv[], Yeah, that is an ugly non-thread safe hack but it safes us to create a copy of the array. */ #ifdef HAVE_W32_SYSTEM +# ifdef _WIN64 + snprintf (extrafdbuf, sizeof extrafdbuf, "-&%llu", + (unsigned long long)exceptclose[i]); +# else snprintf (extrafdbuf, sizeof extrafdbuf, "-&%lu", (unsigned long)exceptclose[i]); +# endif #else snprintf (extrafdbuf, sizeof extrafdbuf, "-&%d", exceptclose[i]); #endif