common: Remove translate_sys2libc_fd_int.

* common/sysutils.c (translate_sys2libc_fd_int): Remove.
(check_special_filename): Use translate_sys2libc_fdstr.
* common/sysutils.h (translate_sys2libc_fd_int): Remove.

--

GnuPG-bug-id: 6551
Signed-off-by: NIIBE Yutaka <gniibe@fsij.org>
This commit is contained in:
NIIBE Yutaka 2023-06-23 13:37:08 +09:00
parent 2756147e39
commit 87a73e8eb0
No known key found for this signature in database
GPG Key ID: 640114AF89DE6054
2 changed files with 1 additions and 20 deletions

View File

@ -556,24 +556,6 @@ translate_sys2libc_fd (gnupg_fd_t fd, int for_write)
#endif
}
/* This is the same as translate_sys2libc_fd but takes an integer
which is assumed to be such an system handle. On WindowsCE the
passed FD is a rendezvous ID and the function finishes the pipe
creation. */
int
translate_sys2libc_fd_int (int fd, int for_write)
{
#ifdef HAVE_W32_SYSTEM
if (fd <= 2)
return fd; /* Do not do this for error, stdin, stdout, stderr. */
return translate_sys2libc_fd ((void*)fd, for_write);
#else
(void)for_write;
return fd;
#endif
}
/*
* Parse the string representation of a file reference (file handle on
@ -697,7 +679,7 @@ check_special_filename (const char *fname, int for_write, int notranslate)
;
if (!fname[i])
return notranslate? atoi (fname)
/**/ : translate_sys2libc_fd_int (atoi (fname), for_write);
/**/ : translate_sys2libc_fdstr (fname, for_write);
}
return -1;
}

View File

@ -73,7 +73,6 @@ unsigned int get_uint_nonce (void);
void gnupg_sleep (unsigned int seconds);
void gnupg_usleep (unsigned int usecs);
int translate_sys2libc_fd (gnupg_fd_t fd, int for_write);
int translate_sys2libc_fd_int (int fd, int for_write);
gpg_error_t gnupg_sys2libc_fdstr (const char *fdstr, int for_write,
gnupg_fd_t *r_hd, int *r_fd);
int translate_sys2libc_fdstr (const char *fdstr, int for_write);