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

Don't unnecessarily change SIGPIPE disposition in unix_sigpipe tests #121554

Merged
merged 1 commit into from
Feb 26, 2024

Conversation

Enselic
Copy link
Member

@Enselic Enselic commented Feb 24, 2024

In auxiliary/sigpipe-utils.rs, all we want to know is the current SIGPIPE disposition. We should not change it. So use libc::sigaction instead of libc::signal. That way we can also remove the code that restores it.

Part of #97889.

In `auxiliary/sigpipe-utils.rs`, all we want to know is the current
`SIGPIPE` disposition. We should not change it. So use `libc::sigaction`
instead of `libc::signal`. That way we can also remove the code that
restores it.
@rustbot
Copy link
Collaborator

rustbot commented Feb 24, 2024

r? @lcnr

rustbot has assigned @lcnr.
They will have a look at your PR within the next two weeks and either review your PR or reassign to another reviewer.

Use r? to explicitly pick a reviewer

@rustbot rustbot added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. labels Feb 24, 2024
@Enselic Enselic changed the title Don't unnecessarily change SIGPIPE disposition in unix_sigpipe tests Don't unnecessarily change SIGPIPE disposition in unix_sigpipe tests Feb 24, 2024
@lcnr
Copy link
Contributor

lcnr commented Feb 26, 2024

r? compiler

@rustbot rustbot assigned oli-obk and unassigned lcnr Feb 26, 2024
@@ -17,17 +17,17 @@ pub fn assert_sigpipe_handler(expected_handler: SignalHandler) {
target_os = "android",
)))]
{
let prev = unsafe { libc::signal(libc::SIGPIPE, libc::SIG_IGN) };
let actual = unsafe {
let mut actual: libc::sigaction = std::mem::zeroed();
Copy link
Contributor

Choose a reason for hiding this comment

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

sad that libc doesn't have a good way to init this, can't even do it fully safely manually, because some fields have private fields :(

@oli-obk
Copy link
Contributor

oli-obk commented Feb 26, 2024

@bors r+ rollup

@bors
Copy link
Contributor

bors commented Feb 26, 2024

📌 Commit f5b9eaf has been approved by oli-obk

It is now in the queue for this repository.

@bors bors added S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Feb 26, 2024
bors added a commit to rust-lang-ci/rust that referenced this pull request Feb 26, 2024
…llaumeGomez

Rollup of 5 pull requests

Successful merges:

 - rust-lang#120656 (Allow tests to specify a `//@ filecheck-flags:` header)
 - rust-lang#120840 (Split Diagnostics for Uncommon Codepoints: Add Individual Identifier Types)
 - rust-lang#121554 (Don't unnecessarily change `SIGPIPE` disposition in `unix_sigpipe` tests)
 - rust-lang#121590 (Correctly handle if rustdoc JS script hash changed)
 - rust-lang#121620 (Fix more rust-lang#121208 fallout (round 3))

r? `@ghost`
`@rustbot` modify labels: rollup
@bors bors merged commit 5bd9092 into rust-lang:master Feb 26, 2024
11 checks passed
@rustbot rustbot added this to the 1.78.0 milestone Feb 26, 2024
rust-timer added a commit to rust-lang-ci/rust that referenced this pull request Feb 26, 2024
Rollup merge of rust-lang#121554 - Enselic:sigaction, r=oli-obk

Don't unnecessarily change `SIGPIPE` disposition in `unix_sigpipe` tests

In `auxiliary/sigpipe-utils.rs`, all we want to know is the current `SIGPIPE` disposition. We should not change it. So use `libc::sigaction` instead of `libc::signal`. That way we can also remove the code that restores it.

Part of rust-lang#97889.
@Enselic Enselic deleted the sigaction branch February 26, 2024 17:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants