Skip to content

Commit 00e63fc

Browse files
committed
small cosmetic fix
1 parent eb474d2 commit 00e63fc

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

serial_windows.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,6 @@ func (port *windowsPort) Close() error {
7575

7676
func (port *windowsPort) Read(p []byte) (int, error) {
7777
var readed uint32
78-
params := &dcb{}
7978
ev, err := createOverlappedEvent()
8079
if err != nil {
8180
return 0, err
@@ -107,6 +106,7 @@ func (port *windowsPort) Read(p []byte) (int, error) {
107106
// a serial port is alive in Windows is to check if the SetCommState
108107
// function fails.
109108

109+
params := &dcb{}
110110
getCommState(port.handle, params)
111111
if err := setCommState(port.handle, params); err != nil {
112112
port.Close()

0 commit comments

Comments
 (0)