diff options
Diffstat (limited to 'src/serialport/qserialport_win.cpp')
-rw-r--r-- | src/serialport/qserialport_win.cpp | 13 |
1 files changed, 4 insertions, 9 deletions
diff --git a/src/serialport/qserialport_win.cpp b/src/serialport/qserialport_win.cpp index 6e1a44f..f176025 100644 --- a/src/serialport/qserialport_win.cpp +++ b/src/serialport/qserialport_win.cpp @@ -104,8 +104,7 @@ bool QSerialPortPrivate::open(QIODevice::OpenMode mode) void QSerialPortPrivate::close() { - if (!::CancelIo(handle)) - setError(getSystemError()); + ::CancelIo(handle); if (notifier) { delete notifier; @@ -124,15 +123,11 @@ void QSerialPortPrivate::close() actualBytesToWrite = 0; if (settingsRestoredOnClose) { - if (!::SetCommState(handle, &restoredDcb)) - setError(getSystemError()); - else if (!::SetCommTimeouts(handle, &restoredCommTimeouts)) - setError(getSystemError()); + ::SetCommState(handle, &restoredDcb); + ::SetCommTimeouts(handle, &restoredCommTimeouts); } - if (!::CloseHandle(handle)) - setError(getSystemError()); - + ::CloseHandle(handle); handle = INVALID_HANDLE_VALUE; } |