From ec1a6fba4c944d95edb2397b47b6cebc59e2758d Mon Sep 17 00:00:00 2001 From: Paul Oliver Date: Wed, 27 Aug 2025 04:10:47 +0000 Subject: Moves commonly used `bracket` combinators into separate module --- hsm-cam/Hsm/Cam.hs | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'hsm-cam/Hsm/Cam.hs') diff --git a/hsm-cam/Hsm/Cam.hs b/hsm-cam/Hsm/Cam.hs index c82cdd7..fe17057 100644 --- a/hsm-cam/Hsm/Cam.hs +++ b/hsm-cam/Hsm/Cam.hs @@ -44,6 +44,7 @@ import Hsm.Cam.FFI , stopCamera , stopCameraManager ) +import Hsm.Core.Bracket (bracketConst, bracketLiftIO_) import Hsm.Log (Log, Severity(Attention, Info, Trace), getLevel, logMsg, makeLoggerIO) import MMAP (mapShared, mkMmapFlags, mmap, munmap, protRead) import System.Directory (doesFileExist, removeFile) @@ -127,8 +128,6 @@ runCam action = do . bracketLiftIO_ createRequest (return ()) . bracket mapDmaBuffer unmapDmaBuffer $ \dmaBuffer -> evalStaticRep (Cam Rep {..}) action where - bracketConst alloc dealloc = bracket alloc dealloc . const - bracketLiftIO_ alloc dealloc = bracket_ (liftIO alloc) (liftIO dealloc) loggerAlloc = do logMsg @"cam" Info "Registering FFI logger" loggerIO <- makeLoggerIO @"cam" -- cgit v1.2.1