mirror of
https://github.com/watchexec/watchexec.git
synced 2024-09-29 22:51:33 +02:00
Implement Display for Signal on windows
This commit is contained in:
parent
2e85658a12
commit
0ade9dfc3a
@ -28,6 +28,28 @@ pub enum Signal {
|
|||||||
SIGUSR2,
|
SIGUSR2,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[cfg(windows)]
|
||||||
|
impl fmt::Display for Signal {
|
||||||
|
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
|
||||||
|
use std::io::Write;
|
||||||
|
use Self::*;
|
||||||
|
write!(
|
||||||
|
f,
|
||||||
|
match self {
|
||||||
|
SIGKILL => "SIGKILL",
|
||||||
|
SIGTERM => "SIGTERM",
|
||||||
|
SIGINT => "SIGINT",
|
||||||
|
SIGHUP => "SIGHUP",
|
||||||
|
SIGSTOP => "SIGSTOP",
|
||||||
|
SIGCONT => "SIGCONT",
|
||||||
|
SIGCHLD => "SIGCHLD",
|
||||||
|
SIGUSR1 => "SIGUSR1",
|
||||||
|
SIGUSR2 => "SIGUSR2",
|
||||||
|
}
|
||||||
|
)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
#[cfg(unix)]
|
#[cfg(unix)]
|
||||||
use nix::libc::*;
|
use nix::libc::*;
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user