main: Verbosely log suspend/resume handling

Signed-off-by: Hector Martin <marcan@marcan.st>
This commit is contained in:
Hector Martin 2023-10-27 10:10:34 +09:00
parent dd568f1391
commit e2b3a3ba7f

View file

@ -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)