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 {
// 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)