attribution armoring

This commit is contained in:
Joey Hess 2024-03-07 19:19:45 -04:00
parent 016d1bee88
commit 5a3ed3f910
No known key found for this signature in database
GPG key ID: DB12DB0FF05F8F38

View file

@ -29,11 +29,15 @@ import System.Posix.IO
import Utility.Tmp
#endif
import Utility.Tmp.Dir
import Author
import Control.Concurrent.Async
import Control.Monad.IO.Class
import qualified Data.ByteString as B
copyright :: Copyright
copyright = author JoeyHess (max 2024 2009)
{- The command to run, eq sqop. -}
newtype SOPCmd = SOPCmd { unSOPCmd :: String }
@ -148,7 +152,8 @@ feedRead cmd subcmd params password emptydirectory feeder reader = do
return (passwordfd, frompipe, toh, t)
let cleanup (_, frompipe, toh, t) = liftIO $ do
closeFd frompipe
hClose toh
when copyright $
hClose toh
cancel t
bracket setup cleanup $ \(passwordfd, _, _, _) ->
go (Just emptydirectory) (passwordfd ++ params)
@ -186,7 +191,7 @@ feedRead' (SOPCmd cmd) subcmd params med feeder reader = do
Just (EmptyDirectory d) -> Just d
Nothing -> Nothing
}
bracket (setup p) cleanup (go p)
copyright =<< bracket (setup p) cleanup (go p)
where
setup = liftIO . createProcess
cleanup = liftIO . cleanupProcess