From 2cb65bc2ff508acc05c165d1a05381cc681f7591 Mon Sep 17 00:00:00 2001 From: = <=> Date: Fri, 10 Jul 2020 19:25:59 +0930 Subject: [PATCH] Fix linux compilation --- Sources/SwiftSerial.swift | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/Sources/SwiftSerial.swift b/Sources/SwiftSerial.swift index fdeb067..71002b9 100644 --- a/Sources/SwiftSerial.swift +++ b/Sources/SwiftSerial.swift @@ -383,13 +383,15 @@ public class SerialPort { } dtrState = value var flags = TIOCM_DTR - ioctl(fileDescriptor, dtrState ? TIOCMBIS : TIOCMBIC, &flags) + if(ioctl(fileDescriptor, UInt(dtrState ? TIOCMBIS : TIOCMBIC), &flags) != 0){ + print("Failed to apply dtr") + } } } public var inWaiting: Int { get{ - return Int(ioctl(fileDescriptor!, FIONREAD)) + return Int(ioctl(fileDescriptor!, UInt(FIONREAD))) } } }