From 7e89331c742afea32a80159be7a54d3ecb1b3eec Mon Sep 17 00:00:00 2001
From: Jens Nolte <git@queezle.net>
Date: Tue, 7 Dec 2021 18:49:18 +0100
Subject: [PATCH] Resetting the errno is not required

---
 src/Q/VT.hs | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/src/Q/VT.hs b/src/Q/VT.hs
index 437b866..93f0b8b 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
-- 
GitLab