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

Sigset conveniance #1959

Merged

Conversation

JonathanWoollett-Light
Copy link
Contributor

@JonathanWoollett-Light JonathanWoollett-Light commented Jan 8, 2023

Adds convenience functions for dealing with SigSet.

let mut sigset = SigSet::empty();
sigset.add(SIGINT);
pthread_sigmask(SigmaskHow::SIG_SETMASK, Some(&sigset), None)

becomes

let sigset = SigSet::from(SIGINT);
pthread_sigmask(SigmaskHow::SIG_SETMASK, Some(&sigset), None)

let mut sigset = SigSet::empty();
sigset.add(SIGINT);
sigset.add(SIGUSR1);
sigset.wait();

becomes

(SIGINT | SIGUSR1).wait();

@JonathanWoollett-Light JonathanWoollett-Light force-pushed the sigset-conveniance branch 2 times, most recently from e13809b to da26900 Compare January 8, 2023 18:41
@rtzoeller
Copy link
Collaborator

Seems worthwhile to add a changelog note about this. Otherwise looks good, thanks!

@JonathanWoollett-Light JonathanWoollett-Light force-pushed the sigset-conveniance branch 2 times, most recently from 0da535c to 263cb45 Compare January 15, 2023 03:27
@JonathanWoollett-Light
Copy link
Contributor Author

@rtzoeller Added change logs notes.

@JonathanWoollett-Light
Copy link
Contributor Author

@rtzoeller Could you please re-review.

@JonathanWoollett-Light JonathanWoollett-Light force-pushed the sigset-conveniance branch 3 times, most recently from b4443d9 to 3a45608 Compare October 1, 2023 12:31
@@ -9,6 +9,23 @@ This project adheres to [Semantic Versioning](https://semver.org/).
- Fix `SigSet` incorrect implementation of `Eq`, `PartialEq` and `Hash`
([#1946](https://github.com/nix-rust/nix/pull/1946))

### Added

- Added `impl From<Signal> for SigSet`.
Copy link
Member

Choose a reason for hiding this comment

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

I don't know what happened here, but this sure is a riotous merge error. Could you fix it please?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Fixed.

Copy link
Member

Choose a reason for hiding this comment

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

### Addded has already been added:

### Added
- Added `impl From<Signal> for SigSet`.
  ([#1959](https://github.com/nix-rust/nix/pull/1959))
- ...

### Changed
- ...

### Added
- Added `Icmp` and `IcmpV6` to `SockProtocol`.
  (#[2103](https://github.com/nix-rust/nix/pull/2103))

There are now two ### Added sections in this file, we need to merge them

@@ -9,6 +9,23 @@ This project adheres to [Semantic Versioning](https://semver.org/).
- Fix `SigSet` incorrect implementation of `Eq`, `PartialEq` and `Hash`
([#1946](https://github.com/nix-rust/nix/pull/1946))

### Added

- Added `impl From<Signal> for SigSet`.
Copy link
Member

Choose a reason for hiding this comment

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

### Addded has already been added:

### Added
- Added `impl From<Signal> for SigSet`.
  ([#1959](https://github.com/nix-rust/nix/pull/1959))
- ...

### Changed
- ...

### Added
- Added `Icmp` and `IcmpV6` to `SockProtocol`.
  (#[2103](https://github.com/nix-rust/nix/pull/2103))

There are now two ### Added sections in this file, we need to merge them

@SteveLauC
Copy link
Member

Except for that duplicate CHANGELOG section, this PR LGTM

BTW, nice improvement!

@JonathanWoollett-Light
Copy link
Contributor Author

JonathanWoollett-Light commented Oct 4, 2023

@SteveLauC

### Addded has already been added:

Yeah but I didn't add the 2nd one, there where 2 ### Added sections before this PR.

@SteveLauC
Copy link
Member

Yeah but I didn't add the 2nd one, there where 2 ### Added sections before this PR.

Get it, would you like to fix them in this PR? Merging them as-is still LGTM, then I will fix it in another PR


The current CHANGELOG.md mode is indeed bad, making contributing experience suck, I hope we can switch to towncrier as soon as possible...

@JonathanWoollett-Light
Copy link
Contributor Author

Yeah but I didn't add the 2nd one, there where 2 ### Added sections before this PR.

Get it, would you like to fix them in this PR? Merging them as-is still LGTM, then I will fix it in another PR

The current CHANGELOG.md mode is indeed bad, making contributing experience suck, I hope we can switch to towncrier as soon as possible...

I think it would make sense to fix this in a specific PR.

@SteveLauC SteveLauC added this pull request to the merge queue Oct 5, 2023
Merged via the queue into nix-rust:master with commit 6906a61 Oct 5, 2023
35 checks passed
@SteveLauC
Copy link
Member

Thanks!

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.

4 participants