-
-
Notifications
You must be signed in to change notification settings - Fork 1.7k
env: use Command::exec() instead of libc::execvp() #9614
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
Conversation
This comment was marked as resolved.
This comment was marked as resolved.
No need to use the unsafe `libc::execvp()`, the standard rust library provides the functionality via the safe function `Command::exec()`. Signed-off-by: Etienne Cordonnier <[email protected]>
b4ec20a to
e27da7e
Compare
|
GNU testsuite comparison: |
|
Thanks! |
|
Does |
|
It does: This causes Here is the correct behavior: |
|
OK, thanks for the feedback that |
|
No problem. Rust reseting inherited signal handlers annoys me. I hope this project can give Rust some motivation to change some of that behavior. :) |
|
@collinfunk rust is already in the process of fixing it, but it's not yet stabilized: rust-lang/rust#97889 (comment) / rust-lang/rust#62569 I'll revert this PR and add a test. I don't think there is a solution preserving ignore_signal using |
|
Follow-up PR #9618 |
|
We should make some integration tests for this behavior so that it gets locked in. I'll try and implement it tonight. Any chance you have some other examples on how this command stuff could manifest issues? |
|
I've already added a test in my PR. what do you want to add? The tracking issue is #8919 |
|
I was seeing there were a few PR in different utilities related to this, was thinking one that tests the behavior for all of the commands that expect this behavior |
|
I'm planning to add something to the GNU test suite, but I don't expect a new release soon. So it won't be helpful immediately. |
No need to use the unsafe
libc::execvp(), the standard rust library provides the functionality via the safe functionCommand::exec().