@@ -208,7 +208,7 @@ bitflags!{
208
208
209
209
#[ repr( i32 ) ]
210
210
#[ derive( Clone , Copy , PartialEq ) ]
211
- pub enum SigFlags {
211
+ pub enum SigmaskHow {
212
212
SIG_BLOCK = libc:: SIG_BLOCK ,
213
213
SIG_UNBLOCK = libc:: SIG_UNBLOCK ,
214
214
SIG_SETMASK = libc:: SIG_SETMASK ,
@@ -268,27 +268,27 @@ impl SigSet {
268
268
/// Gets the currently blocked (masked) set of signals for the calling thread.
269
269
pub fn thread_get_mask ( ) -> Result < SigSet > {
270
270
let mut oldmask: SigSet = unsafe { mem:: uninitialized ( ) } ;
271
- try!( pthread_sigmask ( SigFlags :: SIG_SETMASK , None , Some ( & mut oldmask) ) ) ;
271
+ try!( pthread_sigmask ( SigmaskHow :: SIG_SETMASK , None , Some ( & mut oldmask) ) ) ;
272
272
Ok ( oldmask)
273
273
}
274
274
275
275
/// Sets the set of signals as the signal mask for the calling thread.
276
276
pub fn thread_set_mask ( & self ) -> Result < ( ) > {
277
- pthread_sigmask ( SigFlags :: SIG_SETMASK , Some ( self ) , None )
277
+ pthread_sigmask ( SigmaskHow :: SIG_SETMASK , Some ( self ) , None )
278
278
}
279
279
280
280
/// Adds the set of signals to the signal mask for the calling thread.
281
281
pub fn thread_block ( & self ) -> Result < ( ) > {
282
- pthread_sigmask ( SigFlags :: SIG_BLOCK , Some ( self ) , None )
282
+ pthread_sigmask ( SigmaskHow :: SIG_BLOCK , Some ( self ) , None )
283
283
}
284
284
285
285
/// Removes the set of signals from the signal mask for the calling thread.
286
286
pub fn thread_unblock ( & self ) -> Result < ( ) > {
287
- pthread_sigmask ( SigFlags :: SIG_UNBLOCK , Some ( self ) , None )
287
+ pthread_sigmask ( SigmaskHow :: SIG_UNBLOCK , Some ( self ) , None )
288
288
}
289
289
290
290
/// Sets the set of signals as the signal mask, and returns the old mask.
291
- pub fn thread_swap_mask ( & self , how : SigFlags ) -> Result < SigSet > {
291
+ pub fn thread_swap_mask ( & self , how : SigmaskHow ) -> Result < SigSet > {
292
292
let mut oldmask: SigSet = unsafe { mem:: uninitialized ( ) } ;
293
293
try!( pthread_sigmask ( how, Some ( self ) , Some ( & mut oldmask) ) ) ;
294
294
Ok ( oldmask)
@@ -368,7 +368,7 @@ pub unsafe fn sigaction(signal: Signal, sigaction: &SigAction) -> Result<SigActi
368
368
///
369
369
/// For more information, visit the [pthread_sigmask](http://man7.org/linux/man-pages/man3/pthread_sigmask.3.html),
370
370
/// or [sigprocmask](http://man7.org/linux/man-pages/man2/sigprocmask.2.html) man pages.
371
- pub fn pthread_sigmask ( how : SigFlags ,
371
+ pub fn pthread_sigmask ( how : SigmaskHow ,
372
372
set : Option < & SigSet > ,
373
373
oldset : Option < & mut SigSet > ) -> Result < ( ) > {
374
374
if set. is_none ( ) && oldset. is_none ( ) {
@@ -491,7 +491,7 @@ mod tests {
491
491
let mut mask2 = SigSet :: empty ( ) ;
492
492
mask2. add ( SIGUSR2 ) ;
493
493
494
- let oldmask = mask2. thread_swap_mask ( SigFlags :: SIG_SETMASK ) . unwrap ( ) ;
494
+ let oldmask = mask2. thread_swap_mask ( SigmaskHow :: SIG_SETMASK ) . unwrap ( ) ;
495
495
496
496
assert ! ( oldmask. contains( SIGUSR1 ) ) ;
497
497
assert ! ( !oldmask. contains( SIGUSR2 ) ) ;
0 commit comments