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: <linux-ext4@vger.kernel.org> # v1.43.2
Fixes: 4ccf9e4fe165cf ("libext2fs: add unixfd_io_manager")
Signed-off-by: "Darrick J. Wong" <djwong@kernel.org>
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;