Selaa lähdekoodia

Using O_NONBLOCK for Linux as well

Pavel Yurchenko 11 kuukautta sitten
vanhempi
sitoutus
7661de8353
1 muutettua tiedostoa jossa 1 lisäystä ja 1 poistoa
  1. 1 1
      Sources/SwiftSerial/SerialPort.swift

+ 1 - 1
Sources/SwiftSerial/SerialPort.swift

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