summaryrefslogtreecommitdiffstats
path: root/g10/encrypt.c
diff options
context:
space:
mode:
authorNIIBE Yutaka <gniibe@fsij.org>2022-10-07 04:16:55 +0200
committerNIIBE Yutaka <gniibe@fsij.org>2022-10-07 04:16:55 +0200
commitd68a803c4760415204fb3e7af4c0195ee2cd09ad (patch)
tree1f59b3d48f7b582f97b510249d1153588d7fce5f /g10/encrypt.c
parentwkd: New command --mirror for gpg-wks-client. (diff)
downloadgnupg2-d68a803c4760415204fb3e7af4c0195ee2cd09ad.tar.xz
gnupg2-d68a803c4760415204fb3e7af4c0195ee2cd09ad.zip
gpg: Fix wrong use of FD2INT with iobuf_fdopen_nc.
* g10/decrypt.c (decrypt_message_fd): Use INPUT_FD directly. * g10/encrypt.c (encrypt_crypt): Use FILEFD directly. -- Before 8402815d, original code was with iobuf_open_fd_or_name, which used gnupg_fd_t for the file descriptor (FD2INT was relevant at that time). After the change, because it's not gnupg_fd_t but int, use of FD2INT is irrelevant. Fixes-commit: 8402815d8e0e04a44362968f88b3d484d2395402 Signed-off-by: NIIBE Yutaka <gniibe@fsij.org>
Diffstat (limited to 'g10/encrypt.c')
-rw-r--r--g10/encrypt.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/g10/encrypt.c b/g10/encrypt.c
index dadb726b3..019bf0be4 100644
--- a/g10/encrypt.c
+++ b/g10/encrypt.c
@@ -829,10 +829,10 @@ encrypt_crypt (ctrl_t ctrl, int filefd, const char *filename,
gpg_err_set_errno (ENOSYS);
}
#else
- if (filefd == GNUPG_INVALID_FD)
+ if (filefd == -1)
inp = iobuf_open (filename);
else
- inp = iobuf_fdopen_nc (FD2INT(filefd), "rb");
+ inp = iobuf_fdopen_nc (filefd, "rb");
#endif
if (inp)
iobuf_ioctl (inp, IOBUF_IOCTL_NO_CACHE, 1, NULL);