Skip to content

Commit

Permalink
suppress 'interrupted [code -10]' log message. resolve #87 (#121)
Browse files Browse the repository at this point in the history
  • Loading branch information
djadala authored Feb 24, 2024
1 parent 5514912 commit 2f9ed92
Showing 1 changed file with 4 additions and 1 deletion.
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 {
log.Printf("handle_events: error: %s", Error(errno))
}
}
}
}
Expand Down

0 comments on commit 2f9ed92

Please sign in to comment.