mirror of
https://github.com/tokio-rs/tokio.git
synced 2026-08-15 00:00:15 +02:00
signal: Increase number of signals to 33 for the sake of FreeBSD
Fixes alexcrichton/tokio-signal#21
This commit is contained in:
committed by
Carl Lerche
parent
9a4e4f2308
commit
31b51004f2
+4
-3
@@ -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));
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user