1
0
mirror of git://git.gnupg.org/gnupg.git synced 2024-12-22 10:19:57 +01:00

common,w32: Fix cast from gnupg_fd_t to call _open_osfhandle.

* common/sysutils.c (translate_sys2libc_fd): Use intptr_t.
(gnupg_tmpfile): Likewise.

Signed-off-by: NIIBE Yutaka <gniibe@fsij.org>
This commit is contained in:
NIIBE Yutaka 2019-07-24 14:27:47 +09:00
parent 7bfbb9fa7e
commit a64411c607

View File

@ -380,7 +380,7 @@ translate_sys2libc_fd (gnupg_fd_t fd, int for_write)
/* Note that _open_osfhandle is currently defined to take and return
a long. */
x = _open_osfhandle ((long)fd, for_write ? 1 : 0);
x = _open_osfhandle ((intptr_t)fd, for_write ? 1 : 0);
if (x == -1)
log_error ("failed to translate osfhandle %p\n", (void *) fd);
return x;
@ -511,7 +511,7 @@ gnupg_tmpfile (void)
int fd = (int)file;
fp = _wfdopen (fd, L"w+b");
#else
int fd = _open_osfhandle ((long)file, 0);
int fd = _open_osfhandle ((intptr_t)file, 0);
if (fd == -1)
{
CloseHandle (file);