small cosmetic fix
This commit is contained in:
@@ -75,7 +75,6 @@ func (port *windowsPort) Close() error {
|
|||||||
|
|
||||||
func (port *windowsPort) Read(p []byte) (int, error) {
|
func (port *windowsPort) Read(p []byte) (int, error) {
|
||||||
var readed uint32
|
var readed uint32
|
||||||
params := &dcb{}
|
|
||||||
ev, err := createOverlappedEvent()
|
ev, err := createOverlappedEvent()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return 0, err
|
return 0, err
|
||||||
@@ -107,6 +106,7 @@ func (port *windowsPort) Read(p []byte) (int, error) {
|
|||||||
// a serial port is alive in Windows is to check if the SetCommState
|
// a serial port is alive in Windows is to check if the SetCommState
|
||||||
// function fails.
|
// function fails.
|
||||||
|
|
||||||
|
params := &dcb{}
|
||||||
getCommState(port.handle, params)
|
getCommState(port.handle, params)
|
||||||
if err := setCommState(port.handle, params); err != nil {
|
if err := setCommState(port.handle, params); err != nil {
|
||||||
port.Close()
|
port.Close()
|
||||||
|
|||||||
Reference in New Issue
Block a user