mirror of
https://codeberg.org/icewind/shortcutd.git
synced 2026-06-03 09:14:07 +02:00
crash safety
This commit is contained in:
parent
3307be701d
commit
40fcb96c68
1 changed files with 11 additions and 1 deletions
|
|
@ -62,7 +62,17 @@ impl<M: MethodType<D> + 'static, D: DataType + 'static> MutateTree<M, D> {
|
|||
}
|
||||
}
|
||||
|
||||
fn main() -> Result<(), MainError> {
|
||||
fn main() {
|
||||
loop {
|
||||
std::panic::catch_unwind(|| {
|
||||
run();
|
||||
});
|
||||
|
||||
std::thread::sleep(Duration::from_secs(15));
|
||||
}
|
||||
}
|
||||
|
||||
fn run() -> Result<(), MainError> {
|
||||
let devices = glob::glob("/dev/input/by-id/*-kbd")?
|
||||
.map(|path| Ok(Device::open(&path.unwrap())?))
|
||||
.collect::<Result<Vec<Device>, MainError>>()?;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue