File tree 2 files changed +47
-0
lines changed
2 files changed +47
-0
lines changed Original file line number Diff line number Diff line change @@ -11,6 +11,16 @@ This project adheres to [Semantic Versioning](https://semver.org/).
11
11
12
12
- Fixed the function signature of ` recvmmsg ` , potentially causing UB
13
13
([ #2119 ] ( https://github.com/nix-rust/nix/issues/2119 ) )
14
+ ### Added
15
+
16
+ - Added ` impl From<Signal> for SigSet ` .
17
+ ([ #1959 ] ( https://github.com/nix-rust/nix/pull/1959 ) )
18
+ - Added ` impl std::ops::BitOr for SigSet ` .
19
+ ([ #1959 ] ( https://github.com/nix-rust/nix/pull/1959 ) )
20
+ - Added ` impl std::ops::BitOr for Signal ` .
21
+ ([ #1959 ] ( https://github.com/nix-rust/nix/pull/1959 ) )
22
+ - Added ` impl std::ops::BitOr<Signal> for SigSet `
23
+ ([ #1959 ] ( https://github.com/nix-rust/nix/pull/1959 ) )
14
24
15
25
- Fix ` SignalFd::set_mask ` . In 0.27.0 it would actually close the file
16
26
descriptor.
Original file line number Diff line number Diff line change @@ -9,6 +9,7 @@ use cfg_if::cfg_if;
9
9
use std:: fmt;
10
10
use std:: hash:: { Hash , Hasher } ;
11
11
use std:: mem;
12
+ use std:: ops:: BitOr ;
12
13
#[ cfg( any( target_os = "dragonfly" , target_os = "freebsd" ) ) ]
13
14
use std:: os:: unix:: io:: RawFd ;
14
15
use std:: ptr;
@@ -604,6 +605,42 @@ impl SigSet {
604
605
}
605
606
}
606
607
608
+ impl From <Signal > for SigSet {
609
+ fn from( signal: Signal ) -> SigSet {
610
+ let mut sigset = SigSet :: empty( ) ;
611
+ sigset. add( signal) ;
612
+ sigset
613
+ }
614
+ }
615
+
616
+ impl BitOr for Signal {
617
+ type Output = SigSet ;
618
+
619
+ fn bitor( self , rhs: Self ) -> Self :: Output {
620
+ let mut sigset = SigSet :: empty( ) ;
621
+ sigset. add( self ) ;
622
+ sigset. add( rhs) ;
623
+ sigset
624
+ }
625
+ }
626
+
627
+ impl BitOr <Signal > for SigSet {
628
+ type Output = SigSet ;
629
+
630
+ fn bitor( mut self , rhs: Signal ) -> Self :: Output {
631
+ self . add( rhs) ;
632
+ self
633
+ }
634
+ }
635
+
636
+ impl BitOr for SigSet {
637
+ type Output = Self ;
638
+
639
+ fn bitor( self , rhs: Self ) -> Self :: Output {
640
+ self . iter( ) . chain( rhs. iter( ) ) . collect( )
641
+ }
642
+ }
643
+
607
644
impl AsRef <libc:: sigset_t> for SigSet {
608
645
fn as_ref( & self ) -> & libc:: sigset_t {
609
646
& self . sigset
You can’t perform that action at this time.
0 commit comments