Index: chrome/browser/extensions/api/serial/serial_connection_posix.cc |
diff --git a/chrome/browser/extensions/api/serial/serial_connection_posix.cc b/chrome/browser/extensions/api/serial/serial_connection_posix.cc |
index b1ad1dca317dd01ab87040dc48ea7b44f121d683..18a2119a586248e8dd87f18a6f25572784812ea2 100644 |
--- a/chrome/browser/extensions/api/serial/serial_connection_posix.cc |
+++ b/chrome/browser/extensions/api/serial/serial_connection_posix.cc |
@@ -11,6 +11,10 @@ |
#include <linux/serial.h> |
#endif |
+#if defined(OS_MACOSX) |
+#include <IOKit/serial/ioss.h> |
+#endif |
+ |
namespace extensions { |
namespace { |
@@ -101,6 +105,9 @@ bool SetCustomBitrate(base::PlatformFile file, |
cfsetispeed(config, B38400); |
cfsetospeed(config, B38400); |
return ioctl(file, TIOCSSERIAL, &serial) >= 0; |
+#elif defined(OS_MACOSX) |
+ speed_t speed = static_cast<speed_t>(bitrate); |
+ return ioctl(file, IOSSIOSPEED, &speed) != -1; |
#else |
return false; |
#endif |