mgorny created this revision. mgorny added reviewers: labath, krytarowski, emaste, teemperor. mgorny requested review of this revision.
Disable non-blocking mode that's enabled only for file:// and serial:// protocols. We do not seem to have a really good reason for it, and it only complicates handling partial writes. https://reviews.llvm.org/D112442 Files: lldb/source/Host/posix/ConnectionFileDescriptorPosix.cpp Index: lldb/source/Host/posix/ConnectionFileDescriptorPosix.cpp =================================================================== --- lldb/source/Host/posix/ConnectionFileDescriptorPosix.cpp +++ lldb/source/Host/posix/ConnectionFileDescriptorPosix.cpp @@ -722,13 +722,6 @@ llvm::sys::RetryAfterSignal(-1, ::tcsetattr, fd, TCSANOW, &options); } - int flags = ::fcntl(fd, F_GETFL, 0); - if (flags >= 0) { - if ((flags & O_NONBLOCK) == 0) { - flags |= O_NONBLOCK; - ::fcntl(fd, F_SETFL, flags); - } - } m_io_sp = std::make_shared<NativeFile>(fd, File::eOpenOptionReadWrite, true); return eConnectionStatusSuccess; @@ -761,14 +754,6 @@ return eConnectionStatusError; } - int flags = ::fcntl(fd, F_GETFL, 0); - if (flags >= 0) { - if ((flags & O_NONBLOCK) == 0) { - flags |= O_NONBLOCK; - ::fcntl(fd, F_SETFL, flags); - } - } - llvm::Expected<std::unique_ptr<SerialPort>> serial_sp = SerialPort::Create( fd, File::eOpenOptionReadWrite, serial_options.get(), true); if (!serial_sp) {
Index: lldb/source/Host/posix/ConnectionFileDescriptorPosix.cpp =================================================================== --- lldb/source/Host/posix/ConnectionFileDescriptorPosix.cpp +++ lldb/source/Host/posix/ConnectionFileDescriptorPosix.cpp @@ -722,13 +722,6 @@ llvm::sys::RetryAfterSignal(-1, ::tcsetattr, fd, TCSANOW, &options); } - int flags = ::fcntl(fd, F_GETFL, 0); - if (flags >= 0) { - if ((flags & O_NONBLOCK) == 0) { - flags |= O_NONBLOCK; - ::fcntl(fd, F_SETFL, flags); - } - } m_io_sp = std::make_shared<NativeFile>(fd, File::eOpenOptionReadWrite, true); return eConnectionStatusSuccess; @@ -761,14 +754,6 @@ return eConnectionStatusError; } - int flags = ::fcntl(fd, F_GETFL, 0); - if (flags >= 0) { - if ((flags & O_NONBLOCK) == 0) { - flags |= O_NONBLOCK; - ::fcntl(fd, F_SETFL, flags); - } - } - llvm::Expected<std::unique_ptr<SerialPort>> serial_sp = SerialPort::Create( fd, File::eOpenOptionReadWrite, serial_options.get(), true); if (!serial_sp) {
_______________________________________________ lldb-commits mailing list lldb-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits