Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1437)

Unified Diff: device/serial/serial_io_handler_posix.cc

Issue 2494663003: Explicitly put serial port fd in non-blocking mode on Chrome OS. (Closed)
Patch Set: Created 4 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « device/serial/serial_io_handler_posix.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: device/serial/serial_io_handler_posix.cc
diff --git a/device/serial/serial_io_handler_posix.cc b/device/serial/serial_io_handler_posix.cc
index 59582c5b84e7dea1ffe4b2d8306a103e6e0baebe..8191cc21f3153fc829fa79f018f95144948a23c7 100644
--- a/device/serial/serial_io_handler_posix.cc
+++ b/device/serial/serial_io_handler_posix.cc
@@ -7,6 +7,7 @@
#include <sys/ioctl.h>
#include <termios.h>
+#include "base/files/file_util.h"
#include "base/posix/eintr_wrapper.h"
#include "build/build_config.h"
@@ -283,6 +284,15 @@ bool SerialIoHandlerPosix::ConfigurePortImpl() {
return true;
}
+bool SerialIoHandlerPosix::PostOpen() {
+#if defined(OS_CHROMEOS)
+ // The Chrome OS permission broker does not open devices in async mode.
+ return base::SetNonBlocking(file().GetPlatformFile());
+#else
+ return true;
+#endif
+}
+
SerialIoHandlerPosix::SerialIoHandlerPosix(
scoped_refptr<base::SingleThreadTaskRunner> file_thread_task_runner,
scoped_refptr<base::SingleThreadTaskRunner> ui_thread_task_runner)
« no previous file with comments | « device/serial/serial_io_handler_posix.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698