Commit 8725f322 authored by Committed by KevinBrowse files
linux - Don't log "can't accept" error on close. (#8)
This is a hack which silences an extraneous log message. The message gets reported due to an apparent race condition involving the `sktLoop()` function in `linux/hci/hci.go`. This function implements a socket-read loop that only returns on error. It is called as a Goroutine, and typically continues to run until the process terminates. If client code closes the owning `Device` at an inopportune time (presumably during the socket read), the `Read()` call returns an `io.EOF` error, which causes `NewDevice()` to log the following message: can't accept: skt: EOF Since the API permits the user to close the device at any time, this error message is extraneous. This commit simply inhibits the logging of the error message in case of EOF. This is not a long-term solution, but it does fix the visible issue.
Showing with 6 additions and 1 deletion