Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

suppress 'interrupted [code -10]' log message. resolve #87 #121

Merged
merged 2 commits into from
Feb 24, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion libusb.go
Original file line number Diff line number Diff line change
Expand Up @@ -188,7 +188,10 @@ func (libusbImpl) handleEvents(c *libusbContext, done <-chan struct{}) {
default:
}
if errno := C.libusb_handle_events_timeout_completed((*C.libusb_context)(c), &tv, nil); errno < 0 {
log.Printf("handle_events: error: %s", Error(errno))
// handler can be interrupted by a signal and this doesn't indicate an error, we'll retry on the next loop iteration
if Error(errno) != ErrorInterrupted {
zagrodzki marked this conversation as resolved.
Show resolved Hide resolved
log.Printf("handle_events: error: %s", Error(errno))
}
}
}
}
Expand Down
Loading