+
Skip to content

Conversation

dcarrier
Copy link
Contributor

Adding support for handling SIGEXIT as mentioned in Issue-6628.

Before this change the nix library would return an EINVAL when passing SIGEXIT / EXIT to uutils/coretutils kill.

After this change nix passes 0 to libc kill as shown here.

.try_into()
.map_err(|e| std::io::Error::from_raw_os_error(e as i32))?;
let sig_name = signal_name_by_value(sig);
let sig: Option<Signal> = if sig_name.is_some_and(|name| name == "EXIT") {
Copy link
Contributor

Choose a reason for hiding this comment

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

could you please add a comment, it isn't super obvious :)

Copy link
Contributor Author

@dcarrier dcarrier Apr 24, 2024

Choose a reason for hiding this comment

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

Yes, very good point! Added.

Copy link

GNU testsuite comparison:

GNU test failed: tests/timeout/timeout. tests/timeout/timeout is passing on 'main'. Maybe you have to rebase?

tests/kill: test handling SIGEXIT

kill: pass unqualified None for consistency
@dcarrier
Copy link
Contributor Author

Rebased on main to attempt to fix CI and amend commit to follow best practices.

Copy link
Collaborator

@BenWiederhake BenWiederhake left a comment

Choose a reason for hiding this comment

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

Does exactly what it says on the tin, tests that the invocation works and will never regress. Great!

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.

3 participants

点击 这是indexloc提供的php浏览器服务,不要输入任何密码和下载