aboutsummaryrefslogtreecommitdiffstats
path: root/g10
diff options
context:
space:
mode:
Diffstat (limited to 'g10')
-rw-r--r--g10/decrypt.c2
-rw-r--r--g10/encrypt.c7
2 files changed, 6 insertions, 3 deletions
diff --git a/g10/decrypt.c b/g10/decrypt.c
index fe6fd6389..068b64aed 100644
--- a/g10/decrypt.c
+++ b/g10/decrypt.c
@@ -120,7 +120,7 @@ decrypt_message_fd (ctrl_t ctrl, int input_fd, int output_fd)
pfx = new_progress_context ();
/* Open the message file. */
- fp = iobuf_open_fd_or_name (input_fd, NULL, "rb");
+ fp = iobuf_fdopen_nc (FD2INT(input_fd), "rb");
if (fp && is_secured_file (iobuf_get_fd (fp)))
{
iobuf_close (fp);
diff --git a/g10/encrypt.c b/g10/encrypt.c
index d5835d499..e2e1c05da 100644
--- a/g10/encrypt.c
+++ b/g10/encrypt.c
@@ -510,14 +510,17 @@ encrypt_crypt (ctrl_t ctrl, int filefd, const char *filename,
/* Prepare iobufs. */
#ifdef HAVE_W32_SYSTEM
if (filefd == -1)
- inp = iobuf_open_fd_or_name (GNUPG_INVALID_FD, filename, "rb");
+ inp = iobuf_open (filename);
else
{
inp = NULL;
gpg_err_set_errno (ENOSYS);
}
#else
- inp = iobuf_open_fd_or_name (filefd, filename, "rb");
+ if (filefd == GNUPG_INVALID_FD)
+ inp = iobuf_open (filename);
+ else
+ inp = iobuf_fdopen_nc (FD2INT(filefd), "rb");
#endif
if (inp)
iobuf_ioctl (inp, IOBUF_IOCTL_NO_CACHE, 1, NULL);