From 3d19812f745fac35aab02743c576a51dd9b0714f Mon Sep 17 00:00:00 2001 From: Sergey Belyashov Date: Tue, 13 May 2014 12:40:47 +0400 Subject: Fix setting custom baud rates under Linux This regression was caused by 7c737e0edcb93585856c65890ef34e5c5a28ee6b. The initialization of the (current) serial port info was removed in that commit. Tested on Linux x86_64 with Qt 5.1.1 and 4.8.6. Task-number: QTBUG-38961 Change-Id: Idd3c5dc7eb37093848f33387563ff14567ac54fe Reviewed-by: Denis Shienkov Reviewed-by: Oswald Buddenhagen Reviewed-by: Rafael Roquetto --- src/serialport/qserialport_unix.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/serialport/qserialport_unix.cpp b/src/serialport/qserialport_unix.cpp index 8140e07..dc8d9af 100644 --- a/src/serialport/qserialport_unix.cpp +++ b/src/serialport/qserialport_unix.cpp @@ -260,6 +260,11 @@ bool QSerialPortPrivate::open(QIODevice::OpenMode mode) if (!updateTermios()) return false; +#ifdef Q_OS_LINUX + isCustomBaudRateSupported = (::ioctl(descriptor, TIOCGSERIAL, ¤tSerialInfo) != -1) + && (::ioctl(descriptor, TIOCSSERIAL, ¤tSerialInfo) != -1); +#endif + setExceptionNotificationEnabled(true); if ((flags & O_WRONLY) == 0) -- cgit v1.2.1