Skip to content
Merged

Bugfix #1190

Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion include/fast_io_driver/mfc_impl/mfc_file.h
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ inline void mfc_scatter_write_impl(CFile *cfp, io_scatter_t const *scats, ::std:
auto e{scats + n};
for (; i != e; ++i)
{
mfc_write_n_impl(cfp, reinterpret_cast<::std::byte const *>(scats->base), scats->len);
mfc_write_n_impl(cfp, reinterpret_cast<::std::byte const *>(i->base), i->len);
}
}

Expand Down
9 changes: 8 additions & 1 deletion include/fast_io_hosted/platforms/posix.h
Original file line number Diff line number Diff line change
Expand Up @@ -1273,7 +1273,14 @@ class basic_posix_family_file : public basic_posix_family_io_observer<family, ch
{
return *this;
}
this->fd = ::fast_io::details::sys_dup2(dp.fd, this->fd);
if (this->fd == -1) [[unlikely]]
{
this->fd = ::fast_io::details::sys_dup(dp.fd);
}
else
{
this->fd = ::fast_io::details::sys_dup2(dp.fd, this->fd);
}
return *this;
}
inline constexpr basic_posix_family_file(basic_posix_family_file &&__restrict b) noexcept
Expand Down
2 changes: 1 addition & 1 deletion include/fast_io_hosted/platforms/posix_file_lock.h
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ namespace details
{
inline int fcntl_file_lock(int fd, int cmd, struct flock const *lockp)
{
return ::fcntl(fd, cmd, __builtin_addressof(lockp));
return ::fcntl(fd, cmd, lockp);
}

inline void posix_file_lock_lock_common_impl(int fd, struct flock const &lockp)
Expand Down
Loading