diff --git a/src/Q/VT.hs b/src/Q/VT.hs index 437b8668d8d27d12aefd5be3b409656bffe67dc1..93f0b8bf7563f00527895d30cf8e71e46ce1ed1d 100644 --- a/src/Q/VT.hs +++ b/src/Q/VT.hs @@ -9,9 +9,9 @@ module Q.VT ( import Control.Concurrent import Control.Monad.Catch -import Foreign.Ptr import Foreign import Foreign.C +import Foreign.Ptr import System.Posix.IO import System.Posix.Types (Fd(..)) import Language.C.Inline qualified as C @@ -42,7 +42,6 @@ withFd path = bracket aquire closeFd -- | ioctl without in/out parameter. ioctlDo :: CULong -> Fd -> IO () ioctlDo request (Fd fd) = runInBoundThread do - resetErrno throwErrnoIfMinus1_ "ioctl" do [C.exp| int { ioctl($(int fd), $(unsigned long request)) } |] @@ -53,7 +52,6 @@ isVT :: Fd -> IO Bool isVT (Fd fd) = runInBoundThread do -- Linux always returns KB_101 if the fd is for a console/VT (see ioctl_console man-page) alloca \ptr -> do - resetErrno x <- [C.exp| int { ioctl($(int fd), KDGKBTYPE, $(char* ptr)) } |] if x < 0 then do