controlChar termios cc = unsafePerformIO $ do
val <- _casm_ ``%r = ((struct termios *)%0)->c_cc[%1];''
termios (cc2Word cc)
- if val == ``_POSIX_VDISABLE''
+ if val == (``_POSIX_VDISABLE''::Int)
then return Nothing
else return (Just (toEnum val))
getTerminalAttributes (FD# fd) = do
bytes <- allocChars ``sizeof(struct termios)''
rc <- _casm_ ``%r = tcgetattr(%0,(struct termios *)%1);'' fd bytes
- if rc /= -1
+ if rc /= ((-1)::Int)
then freeze bytes
else syserr "getTerminalAttributes"
setTerminalAttributes (FD# fd) termios state = do
rc <- _casm_ ``%r = tcsetattr(%0,%1,(struct termios *)%2);''
fd (state2Int state) termios
- if rc /= -1
+ if rc /= ((-1)::Int)
then return ()
else syserr "setTerminalAttributes"
where
getTerminalProcessGroupID :: Fd -> IO ProcessGroupID
getTerminalProcessGroupID (FD# fd) = do
pgid <- _ccall_ tcgetpgrp fd
- if pgid /= -1
+ if pgid /= ((-1)::Int)
then return pgid
else syserr "getTerminalProcessGroupID"