From: Darrick J. Wong Date: Thu, 28 Aug 2025 17:30:38 +0000 (-0700) Subject: libext2fs: use F_GETFL, not F_GETFD, in unixfd_open X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=ff659478ec0eb25951ee23641ae7f359e1a132f5;p=thirdparty%2Fe2fsprogs.git libext2fs: use F_GETFL, not F_GETFD, in unixfd_open F_GETFD is the fcntl command that returns FD_* flags, but the callsite wants to look at the O_* flags. F_GETFL is the fcntl command that returns the O_* flags, so change the subcommand to be correct. Cc: # v1.43.2 Fixes: 4ccf9e4fe165cf ("libext2fs: add unixfd_io_manager") Signed-off-by: "Darrick J. Wong" --- diff --git a/lib/ext2fs/unix_io.c b/lib/ext2fs/unix_io.c index cb408f51..adbdd5f6 100644 --- a/lib/ext2fs/unix_io.c +++ b/lib/ext2fs/unix_io.c @@ -1086,7 +1086,7 @@ static errcode_t unixfd_open(const char *str_fd, int flags, fd = atoi(str_fd); #if defined(HAVE_FCNTL) - fd_flags = fcntl(fd, F_GETFD); + fd_flags = fcntl(fd, F_GETFL); if (fd_flags == -1) return EBADF;