Skip to content

Commit

Permalink
Rename HowFlags to SigFlags and SockFlags to SaFlags for consistency.
Browse files Browse the repository at this point in the history
  • Loading branch information
fiveop committed Feb 29, 2016
1 parent b70f43c commit a8e37d6
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions src/sys/signal.rs
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ pub const SIGEMT: libc::c_int = 7;
pub const NSIG: libc::c_int = 32;

bitflags!{
flags SockFlag: libc::c_int {
flags SaFlag: libc::c_int {
const SA_NOCLDSTOP = libc::SA_NOCLDSTOP,
const SA_NOCLDWAIT = libc::SA_NOCLDWAIT,
const SA_NODEFER = libc::SA_NODEFER,
Expand All @@ -57,7 +57,7 @@ bitflags!{
}

bitflags!{
flags HowFlag: libc::c_int {
flags SigFlag: libc::c_int {
const SIG_BLOCK = libc::SIG_BLOCK,
const SIG_UNBLOCK = libc::SIG_UNBLOCK,
const SIG_SETMASK = libc::SIG_SETMASK,
Expand Down Expand Up @@ -118,7 +118,7 @@ impl SigSet {
/// Gets the currently blocked (masked) set of signals for the calling thread.
pub fn thread_get_mask() -> Result<SigSet> {
let mut oldmask: SigSet = unsafe { mem::uninitialized() };
try!(pthread_sigmask(HowFlag::empty(), None, Some(&mut oldmask)));
try!(pthread_sigmask(SigFlag::empty(), None, Some(&mut oldmask)));
Ok(oldmask)
}

Expand All @@ -138,7 +138,7 @@ impl SigSet {
}

/// Sets the set of signals as the signal mask, and returns the old mask.
pub fn thread_swap_mask(&self, how: HowFlag) -> Result<SigSet> {
pub fn thread_swap_mask(&self, how: SigFlag) -> Result<SigSet> {
let mut oldmask: SigSet = unsafe { mem::uninitialized() };
try!(pthread_sigmask(how, Some(self), Some(&mut oldmask)));
Ok(oldmask)
Expand All @@ -162,7 +162,7 @@ impl AsRef<libc::sigset_t> for SigSet {

#[allow(unknown_lints)]
#[allow(raw_pointer_derive)]
#[derive(Clone, Copy)]
#[derive(Clone, Copy, PartialEq)]
pub enum SigHandler {
SigDfl,
SigIgn,
Expand All @@ -177,7 +177,7 @@ pub struct SigAction {
impl SigAction {
/// This function will set or unset the flag `SA_SIGINFO` depending on the
/// type of the `handler` argument.
pub fn new(handler: SigHandler, flags: SockFlag, mask: SigSet) -> SigAction {
pub fn new(handler: SigHandler, flags: SaFlag, mask: SigSet) -> SigAction {
let mut s = unsafe { mem::uninitialized::<libc::sigaction>() };
s.sa_sigaction = match handler {
SigHandler::SigDfl => unsafe { mem::transmute(libc::SIG_DFL) },
Expand Down Expand Up @@ -219,7 +219,7 @@ pub unsafe fn sigaction(signum: SigNum, sigaction: &SigAction) -> Result<SigActi
///
/// For more information, visit the [pthread_sigmask](http://man7.org/linux/man-pages/man3/pthread_sigmask.3.html),
/// or [sigprocmask](http://man7.org/linux/man-pages/man2/sigprocmask.2.html) man pages.
pub fn pthread_sigmask(how: HowFlag,
pub fn pthread_sigmask(how: SigFlag,
set: Option<&SigSet>,
oldset: Option<&mut SigSet>) -> Result<()> {
if set.is_none() && oldset.is_none() {
Expand Down

0 comments on commit a8e37d6

Please sign in to comment.