Skip to content

Commit b7483e3

Browse files
committed
Report the actual error instead of nil
1 parent 0996f84 commit b7483e3

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

serial_unix.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -241,7 +241,7 @@ func nativeOpen(portName string, mode *Mode) (*unixPort, error) {
241241
// Explicitly disable RTS/CTS flow control
242242
setTermSettingsCtsRts(false, settings)
243243

244-
if port.setTermSettings(settings) != nil {
244+
if err = port.setTermSettings(settings); err != nil {
245245
port.Close()
246246
return nil, &PortError{code: InvalidSerialPort, causedBy: fmt.Errorf("error setting term settings: %w", err)}
247247
}

0 commit comments

Comments
 (0)