signal: Increase number of signals to 33 for the sake of FreeBSD

Fixes alexcrichton/tokio-signal#21
This commit is contained in:
Markus Westerlind
2018-09-10 11:30:04 -07:00
committed by Carl Lerche
parent 9a4e4f2308
commit 31b51004f2
+4 -3
View File
@@ -33,7 +33,8 @@ pub use self::libc::{SIGUSR1, SIGUSR2, SIGINT, SIGTERM};
pub use self::libc::{SIGALRM, SIGHUP, SIGPIPE, SIGQUIT, SIGTRAP};
// Number of different unix signals
const SIGNUM: usize = 32;
// (FreeBSD has 33)
const SIGNUM: usize = 33;
struct SignalInfo {
pending: AtomicBool,
@@ -48,7 +49,7 @@ struct SignalInfo {
struct Globals {
sender: UnixStream,
receiver: UnixStream,
signals: [SignalInfo; SIGNUM],
signals: Vec<SignalInfo>,
}
impl Default for SignalInfo {
@@ -74,7 +75,7 @@ fn globals() -> &'static Globals {
let globals = Globals {
sender: sender,
receiver: receiver,
signals: Default::default(),
signals: (0..SIGNUM).map(|_| Default::default()).collect(),
};
GLOBALS = Box::into_raw(Box::new(globals));
});