small cosmetic fix

This commit is contained in:
Cristian Maglie
2020-05-11 00:02:01 +01:00
parent eb474d2569
commit 00e63fcc18

View File

@@ -75,7 +75,6 @@ func (port *windowsPort) Close() error {
func (port *windowsPort) Read(p []byte) (int, error) {
var readed uint32
params := &dcb{}
ev, err := createOverlappedEvent()
if err != nil {
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
// function fails.
params := &dcb{}
getCommState(port.handle, params)
if err := setCommState(port.handle, params); err != nil {
port.Close()