Jelajahi Sumber

Opening port fix

Pavel Yurchenko 11 bulan lalu
induk
melakukan
646184e5dd
1 mengubah file dengan 1 tambahan dan 1 penghapusan
  1. 1 1
      Sources/SwiftSerial/SerialPort.swift

+ 1 - 1
Sources/SwiftSerial/SerialPort.swift

@@ -44,7 +44,7 @@ public class SerialPort {
 		#if os(Linux)
 		#if os(Linux)
 		fileDescriptor = open(path, readWriteParam | O_NOCTTY)
 		fileDescriptor = open(path, readWriteParam | O_NOCTTY)
 		#elseif os(OSX)
 		#elseif os(OSX)
-		fileDescriptor = open(path, readWriteParam | O_NOCTTY | O_EXLOCK)
+		fileDescriptor = open(path, readWriteParam | O_NOCTTY | O_EXLOCK | O_NONBLOCK)
 		#endif
 		#endif
 
 
 		// Throw error if open() failed
 		// Throw error if open() failed