fix reversion
It was not the wrong handle. The handle was not being closed, so bup
kept running.
Before 2670890b17
, the code was:
withHandle StdinHandle createProcessSuccess cmd feeder
The stdin handle was not closed by the feeder.
Testing this:
withHandle StdinHandle createProcessSuccess (proc "cat" []) (\h -> hPutStrLn h "hi")
There's a rather long pause, a couple seconds, before it completes, but
it does complete. With hClose h, it immediately completes. This must be
the GC noticing that h is out of scope and closing it.
It seems likely that the old code worked only by that accident.
So, other similar changes made in that and nearby commits may also
have this problem, and need to explicitly close handles that were
somehow implicitly closed before.
This commit is contained in:
parent
291774779f
commit
ef0024444b
1 changed files with 4 additions and 2 deletions
|
@ -164,10 +164,12 @@ store r buprepo = byteStorer $ \k b p -> do
|
|||
, std_err = UseHandle nullh
|
||||
}
|
||||
else cmd
|
||||
feeder = \h -> meteredWrite p h b
|
||||
feeder = \h -> do
|
||||
meteredWrite p h b
|
||||
hClose h
|
||||
in withCreateProcess cmd' (go feeder cmd')
|
||||
where
|
||||
go feeder p _ (Just h) _ pid =
|
||||
go feeder p (Just h) _ _ pid =
|
||||
forceSuccessProcess p pid
|
||||
`after`
|
||||
feeder h
|
||||
|
|
Loading…
Reference in a new issue