From 16d135c39648e7f80ce0ff7e442c753a17e7fa4a Mon Sep 17 00:00:00 2001 From: NIIBE Yutaka Date: Tue, 11 Jul 2023 11:21:05 +0900 Subject: [PATCH] common: Change iobuf_fdopen argument type to gnupg_fd_t. * common/iobuf.h (iobuf_fdopen): Use gnupg_fd_t. * common/iobuf.c (iobuf_fdopen): Use gnupg_fd_t. (iobuf_sockopen): Call do_iobuf_fdopen. -- GnuPG-bug-id: 6580 Signed-off-by: NIIBE Yutaka --- common/iobuf.c | 5 ++--- common/iobuf.h | 2 +- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/common/iobuf.c b/common/iobuf.c index 2427e4f19..3c5dc800c 100644 --- a/common/iobuf.c +++ b/common/iobuf.c @@ -1522,9 +1522,8 @@ do_iobuf_fdopen (gnupg_fd_t fp, const char *mode, int keep_open) iobuf_t -iobuf_fdopen (int fd, const char *mode) +iobuf_fdopen (gnupg_fd_t fp, const char *mode) { - gnupg_fd_t fp = INT2FD (fd); return do_iobuf_fdopen (fp, mode, 0); } @@ -1583,7 +1582,7 @@ iobuf_sockopen (int fd, const char *mode) log_debug ("iobuf-%d.%d: sockopen '%s'\n", a->no, a->subno, scx->fname); iobuf_ioctl (a, IOBUF_IOCTL_NO_CACHE, 1, NULL); #else - a = iobuf_fdopen (fd, mode); + a = do_iobuf_fdopen (fd, mode, 0); #endif return a; } diff --git a/common/iobuf.h b/common/iobuf.h index c523b8c96..4a723908d 100644 --- a/common/iobuf.h +++ b/common/iobuf.h @@ -333,7 +333,7 @@ iobuf_t iobuf_openrw (const char *fname); creates an input filter. Note: MODE must reflect the file descriptors actual mode! When the filter is destroyed, the file descriptor is closed. */ -iobuf_t iobuf_fdopen (int fd, const char *mode); +iobuf_t iobuf_fdopen (gnupg_fd_t fd, const char *mode); /* Like iobuf_fdopen, but doesn't close the file descriptor when the filter is destroyed. */