Skip to content

Commit 2f9ed92

Browse files
authored
suppress 'interrupted [code -10]' log message. resolve #87 (#121)
1 parent 5514912 commit 2f9ed92

1 file changed

Lines changed: 4 additions & 1 deletion

File tree

libusb.go

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -188,7 +188,10 @@ func (libusbImpl) handleEvents(c *libusbContext, done <-chan struct{}) {
188188
default:
189189
}
190190
if errno := C.libusb_handle_events_timeout_completed((*C.libusb_context)(c), &tv, nil); errno < 0 {
191-
log.Printf("handle_events: error: %s", Error(errno))
191+
// handler can be interrupted by a signal and this doesn't indicate an error, we'll retry on the next loop iteration
192+
if Error(errno) != ErrorInterrupted {
193+
log.Printf("handle_events: error: %s", Error(errno))
194+
}
192195
}
193196
}
194197
}

0 commit comments

Comments
 (0)