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

Unified Diff: device/serial/serial_io_handler_posix.cc

Issue 2494513002: 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 7f0d45883d925cde2ea7313f8b21305bd2009496..a2ca2e2309630af6bfef68847675b8404a5c8a3d 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"
@@ -281,6 +282,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