瀏覽代碼

Using O_NONBLOCK for Linux as well

Pavel Yurchenko 11 月之前
父節點
當前提交
7661de8353
共有 1 個文件被更改,包括 1 次插入1 次删除
  1. 1 1
      Sources/SwiftSerial/SerialPort.swift

+ 1 - 1
Sources/SwiftSerial/SerialPort.swift

@@ -42,7 +42,7 @@ public class SerialPort {
 		}
 
 		#if os(Linux)
-		fileDescriptor = open(path, readWriteParam | O_NOCTTY)
+		fileDescriptor = open(path, readWriteParam | O_NOCTTY | O_NONBLOCK)
 		#elseif os(OSX)
 		fileDescriptor = open(path, readWriteParam | O_NOCTTY | O_EXLOCK | O_NONBLOCK)
 		#endif