From 02e0d4837e279486ffa61f315eeeb01209f5575b Mon Sep 17 00:00:00 2001 From: Yeo Kheng Meng Date: Sat, 29 Oct 2016 21:11:40 +0800 Subject: [PATCH] remove nonblock flag to prevent massive cpu usage during reading. Will require use of /dev/cu.* only --- Sources/SwiftSerial.swift | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Sources/SwiftSerial.swift b/Sources/SwiftSerial.swift index fb39ec6..2236f05 100644 --- a/Sources/SwiftSerial.swift +++ b/Sources/SwiftSerial.swift @@ -248,7 +248,7 @@ public class SerialPort { #if os(Linux) fileDescriptor = open(path, readWriteParam | O_NOCTTY) #elseif os(OSX) - fileDescriptor = open(path, readWriteParam | O_NOCTTY | O_EXLOCK | O_NONBLOCK) + fileDescriptor = open(path, readWriteParam | O_NOCTTY | O_EXLOCK) #endif // Throw error if open() failed