diff options
author | Joey Hess <joeyh@joeyh.name> | 2015-04-06 17:11:51 -0400 |
---|---|---|
committer | Joey Hess <joeyh@joeyh.name> | 2015-04-06 17:12:38 -0400 |
commit | e7ea63548b6b33c14f94ec1a2c7c08f2b205b83d (patch) | |
tree | bd75779e8f4e168a877ec2303af4a9bba89ada56 /Utility | |
parent | 22ee5d7373a88fc3b1e532fdf406aa22153050e3 (diff) |
Fixes a bug in the last release that caused rsync and possibly other commands to hang at the end of a file transfer.
Stderr reader blocks waiting for all stderr, and so blocks the process ever
exiting.
I tried several ways to get around this, but no success yet. For now,
disable the stderr reader entirely.
Diffstat (limited to 'Utility')
-rw-r--r-- | Utility/Metered.hs | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/Utility/Metered.hs b/Utility/Metered.hs index 54f038f81..9a0b726a7 100644 --- a/Utility/Metered.hs +++ b/Utility/Metered.hs @@ -165,10 +165,10 @@ type ProgressParser = String -> (Maybe BytesProcessed, String) -} commandMeter :: ProgressParser -> OutputHandler -> MeterUpdate -> FilePath -> [CommandParam] -> IO Bool commandMeter progressparser oh meterupdate cmd params = catchBoolIO $ - withOEHandles createProcessSuccess p $ \(outh, errh) -> do - ep <- async $ handlestderr errh + withHandle StdoutHandle createProcessSuccess p $ \outh -> do + -- ep <- async $ handlestderr errh op <- async $ feedprogress zeroBytesProcessed [] outh - wait ep + -- wait ep wait op where p = proc cmd (toCommand params) @@ -204,12 +204,12 @@ demeterCommand oh cmd params = demeterCommandEnv oh cmd params Nothing demeterCommandEnv :: OutputHandler -> FilePath -> [CommandParam] -> Maybe [(String, String)] -> IO Bool demeterCommandEnv oh cmd params environ = catchBoolIO $ - withOEHandles createProcessSuccess p $ \(outh, errh) -> do - ep <- async $ avoidProgress True errh $ stderrHandler oh + withHandle StdoutHandle createProcessSuccess p $ \outh -> do + -- ep <- async $ avoidProgress True errh $ stderrHandler oh op <- async $ avoidProgress True outh $ \l -> unless (quietMode oh) $ putStrLn l - wait ep + -- wait ep wait op return True where |