mirror of
https://github.com/ivabus/speakersafetyd
synced 2024-11-22 16:25:06 +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 {
|
loop {
|
||||||
// Block while we're reading into the buffer
|
// Block while we're reading into the buffer
|
||||||
io.readi(&mut buf)
|
let read = io
|
||||||
|
.readi(&mut buf)
|
||||||
.or_else(|e| {
|
.or_else(|e| {
|
||||||
if e.errno() == Errno::ESTRPIPE {
|
if e.errno() == Errno::ESTRPIPE {
|
||||||
|
warn!("Suspend detected!");
|
||||||
// Resume handling
|
// Resume handling
|
||||||
loop {
|
loop {
|
||||||
match pcm.resume() {
|
match pcm.resume() {
|
||||||
|
@ -234,6 +236,7 @@ fn main() {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
.unwrap();
|
.unwrap();
|
||||||
|
warn!("Resume successful");
|
||||||
io.readi(&mut buf)
|
io.readi(&mut buf)
|
||||||
} else {
|
} else {
|
||||||
Err(e)
|
Err(e)
|
||||||
|
|
Loading…
Reference in a new issue