convert to withCreateProcess for async exception safety
This handles all createProcessSuccess callers, and aside from process pools, the complete conversion of all process running to async exception safety should be complete now. Also, was able to remove from Utility.Process the old API that I now know was not a good idea. And proof it was bad: The code size went *down*, despite there being a fair bit of boilerplate for some future API to reduce.
This commit is contained in:
parent
12e7d52c8b
commit
2670890b17
16 changed files with 196 additions and 191 deletions
|
@ -57,11 +57,12 @@ copyCoW meta src dest
|
|||
void $ tryIO $ removeFile dest
|
||||
-- When CoW is not supported, cp will complain to stderr,
|
||||
-- so have to discard its stderr.
|
||||
ok <- catchBoolIO $ do
|
||||
withQuietOutput createProcessSuccess $
|
||||
proc "cp" $ toCommand $
|
||||
params ++ [File src, File dest]
|
||||
return True
|
||||
ok <- catchBoolIO $ withNullHandle $ \nullh ->
|
||||
let p = (proc "cp" $ toCommand $ params ++ [File src, File dest])
|
||||
{ std_out = UseHandle nullh
|
||||
, std_err = UseHandle nullh
|
||||
}
|
||||
in withCreateProcess p $ \_ _ _ -> checkSuccessProcess
|
||||
-- When CoW is not supported, cp creates the destination
|
||||
-- file but leaves it empty.
|
||||
unless ok $
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue