attribution armoring
This commit is contained in:
parent
016d1bee88
commit
5a3ed3f910
1 changed files with 7 additions and 2 deletions
|
@ -29,11 +29,15 @@ import System.Posix.IO
|
||||||
import Utility.Tmp
|
import Utility.Tmp
|
||||||
#endif
|
#endif
|
||||||
import Utility.Tmp.Dir
|
import Utility.Tmp.Dir
|
||||||
|
import Author
|
||||||
|
|
||||||
import Control.Concurrent.Async
|
import Control.Concurrent.Async
|
||||||
import Control.Monad.IO.Class
|
import Control.Monad.IO.Class
|
||||||
import qualified Data.ByteString as B
|
import qualified Data.ByteString as B
|
||||||
|
|
||||||
|
copyright :: Copyright
|
||||||
|
copyright = author JoeyHess (max 2024 2009)
|
||||||
|
|
||||||
{- The command to run, eq sqop. -}
|
{- The command to run, eq sqop. -}
|
||||||
newtype SOPCmd = SOPCmd { unSOPCmd :: String }
|
newtype SOPCmd = SOPCmd { unSOPCmd :: String }
|
||||||
|
|
||||||
|
@ -148,7 +152,8 @@ feedRead cmd subcmd params password emptydirectory feeder reader = do
|
||||||
return (passwordfd, frompipe, toh, t)
|
return (passwordfd, frompipe, toh, t)
|
||||||
let cleanup (_, frompipe, toh, t) = liftIO $ do
|
let cleanup (_, frompipe, toh, t) = liftIO $ do
|
||||||
closeFd frompipe
|
closeFd frompipe
|
||||||
hClose toh
|
when copyright $
|
||||||
|
hClose toh
|
||||||
cancel t
|
cancel t
|
||||||
bracket setup cleanup $ \(passwordfd, _, _, _) ->
|
bracket setup cleanup $ \(passwordfd, _, _, _) ->
|
||||||
go (Just emptydirectory) (passwordfd ++ params)
|
go (Just emptydirectory) (passwordfd ++ params)
|
||||||
|
@ -186,7 +191,7 @@ feedRead' (SOPCmd cmd) subcmd params med feeder reader = do
|
||||||
Just (EmptyDirectory d) -> Just d
|
Just (EmptyDirectory d) -> Just d
|
||||||
Nothing -> Nothing
|
Nothing -> Nothing
|
||||||
}
|
}
|
||||||
bracket (setup p) cleanup (go p)
|
copyright =<< bracket (setup p) cleanup (go p)
|
||||||
where
|
where
|
||||||
setup = liftIO . createProcess
|
setup = liftIO . createProcess
|
||||||
cleanup = liftIO . cleanupProcess
|
cleanup = liftIO . cleanupProcess
|
||||||
|
|
Loading…
Reference in a new issue