Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Menu
Open sidebar
Glasgow Haskell Compiler
Packages
Cabal
Commits
97a48d1a
Commit
97a48d1a
authored
Jan 28, 2008
by
Simon Marlow
Browse files
rawSystemStdout': do hGetContents synchonously, to avoid a race condition
parent
4eb65a26
Changes
1
Hide whitespace changes
Inline
Side-by-side
Distribution/Simple/Utils.hs
View file @
97a48d1a
...
...
@@ -259,7 +259,11 @@ rawSystemStdout' verbosity path args = do
-- fork off a thread to pull on (and discard) the stderr
-- so if the process writes to stderr we do not block.
forkIO
$
hGetContents
errh
>>=
evaluate
.
length
>>
return
()
-- NB. do the hGetContents synchronously, otherwise the outer
-- bracket can exit before this thread has run, and hGetContents
-- will fail.
err
<-
hGetContents
errh
forkIO
$
do
evaluate
(
length
err
);
return
()
-- wait for all the output
output
<-
hGetContents
outh
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment