Skip to content

Commit 21d1f17

Browse files
committed
Rename SigFlags to SigmaskHow
1 parent ce9b020 commit 21d1f17

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
lines changed

src/sys/signal.rs

+8-8
Original file line numberDiff line numberDiff line change
@@ -208,7 +208,7 @@ bitflags!{
208208

209209
#[repr(i32)]
210210
#[derive(Clone, Copy, PartialEq)]
211-
pub enum SigFlags {
211+
pub enum SigmaskHow {
212212
SIG_BLOCK = libc::SIG_BLOCK,
213213
SIG_UNBLOCK = libc::SIG_UNBLOCK,
214214
SIG_SETMASK = libc::SIG_SETMASK,
@@ -268,27 +268,27 @@ impl SigSet {
268268
/// Gets the currently blocked (masked) set of signals for the calling thread.
269269
pub fn thread_get_mask() -> Result<SigSet> {
270270
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)));
272272
Ok(oldmask)
273273
}
274274

275275
/// Sets the set of signals as the signal mask for the calling thread.
276276
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)
278278
}
279279

280280
/// Adds the set of signals to the signal mask for the calling thread.
281281
pub fn thread_block(&self) -> Result<()> {
282-
pthread_sigmask(SigFlags::SIG_BLOCK, Some(self), None)
282+
pthread_sigmask(SigmaskHow::SIG_BLOCK, Some(self), None)
283283
}
284284

285285
/// Removes the set of signals from the signal mask for the calling thread.
286286
pub fn thread_unblock(&self) -> Result<()> {
287-
pthread_sigmask(SigFlags::SIG_UNBLOCK, Some(self), None)
287+
pthread_sigmask(SigmaskHow::SIG_UNBLOCK, Some(self), None)
288288
}
289289

290290
/// 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> {
292292
let mut oldmask: SigSet = unsafe { mem::uninitialized() };
293293
try!(pthread_sigmask(how, Some(self), Some(&mut oldmask)));
294294
Ok(oldmask)
@@ -368,7 +368,7 @@ pub unsafe fn sigaction(signal: Signal, sigaction: &SigAction) -> Result<SigActi
368368
///
369369
/// For more information, visit the [pthread_sigmask](http://man7.org/linux/man-pages/man3/pthread_sigmask.3.html),
370370
/// 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,
372372
set: Option<&SigSet>,
373373
oldset: Option<&mut SigSet>) -> Result<()> {
374374
if set.is_none() && oldset.is_none() {
@@ -491,7 +491,7 @@ mod tests {
491491
let mut mask2 = SigSet::empty();
492492
mask2.add(SIGUSR2);
493493

494-
let oldmask = mask2.thread_swap_mask(SigFlags::SIG_SETMASK).unwrap();
494+
let oldmask = mask2.thread_swap_mask(SigmaskHow::SIG_SETMASK).unwrap();
495495

496496
assert!(oldmask.contains(SIGUSR1));
497497
assert!(!oldmask.contains(SIGUSR2));

0 commit comments

Comments
 (0)