in mcumgr/mcumgr.go [35:46]
func stopXport() {
x, err := cli.GetXportIfOpen()
if err == nil {
// Don't attempt to close a serial transport. Attempting to close
// the serial port while a read is in progress (in MacOS) just
// blocks until the read completes. Instead, let the OS close the
// port on termination.
if _, ok := x.(*nmserial.SerialXport); !ok {
x.Stop()
}
}
}