Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor: make dup3 wrapper call the real dup3 #2268

Merged
merged 3 commits into from
Jan 6, 2024

Conversation

SteveLauC
Copy link
Member

What does this PR do

Pick up #960, closes #939

Before this PR, we were emulating dup3() with dup2() and fcntl(), and thus can cause a race condition, this PR makes the dup3() wrapper involve the real dup3().

Checklist:

  • I have read CONTRIBUTING.md
  • I have written necessary tests and rustdoc comments
  • A change log has been added if this PR modifies nix's API

@@ -0,0 +1 @@
Changed the `dup3` wrapper to perform a real call to `dup3` instead of emulating it via `dup2` and `fcntl`
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would call this "Fixed"

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good catch! done

@asomers asomers added this pull request to the merge queue Jan 6, 2024
Merged via the queue into nix-rust:master with commit aeea7cf Jan 6, 2024
35 checks passed
@SteveLauC SteveLauC deleted the dup3 branch January 7, 2024 02:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

unistd::dup3 never uses the dup3 syscall (even if it might be available)
2 participants