mirror of
https://github.com/ivabus/speakersafetyd
synced 2024-11-22 08:15:07 +03:00
main: Verbosely log suspend/resume handling
Signed-off-by: Hector Martin <marcan@marcan.st>
This commit is contained in:
parent
dd568f1391
commit
e2b3a3ba7f
1 changed files with 4 additions and 1 deletions
|
@ -222,9 +222,11 @@ fn main() {
|
|||
|
||||
loop {
|
||||
// Block while we're reading into the buffer
|
||||
io.readi(&mut buf)
|
||||
let read = io
|
||||
.readi(&mut buf)
|
||||
.or_else(|e| {
|
||||
if e.errno() == Errno::ESTRPIPE {
|
||||
warn!("Suspend detected!");
|
||||
// Resume handling
|
||||
loop {
|
||||
match pcm.resume() {
|
||||
|
@ -234,6 +236,7 @@ fn main() {
|
|||
}
|
||||
}
|
||||
.unwrap();
|
||||
warn!("Resume successful");
|
||||
io.readi(&mut buf)
|
||||
} else {
|
||||
Err(e)
|
||||
|
|
Loading…
Reference in a new issue