mirror of
https://github.com/RGBCube/serenity
synced 2025-07-25 17:57:35 +00:00
Shell: Fix incorrect fcntl usage
FD_CLOEXEC is a file descriptor flag, so one must use F_{G,S}ETFD instead.
This commit is contained in:
parent
fd80e7a339
commit
f248145e64
1 changed files with 2 additions and 2 deletions
|
@ -2118,8 +2118,8 @@ SavedFileDescriptors::SavedFileDescriptors(const NonnullRefPtrVector<AST::Rewiri
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
auto flags = fcntl(new_fd, F_GETFL);
|
auto flags = fcntl(new_fd, F_GETFD);
|
||||||
auto rc = fcntl(new_fd, F_SETFL, flags | FD_CLOEXEC);
|
auto rc = fcntl(new_fd, F_SETFD, flags | FD_CLOEXEC);
|
||||||
VERIFY(rc == 0);
|
VERIFY(rc == 0);
|
||||||
|
|
||||||
m_saves.append({ rewiring.new_fd, new_fd });
|
m_saves.append({ rewiring.new_fd, new_fd });
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue