Skip to content

Commit

Permalink
Circumvent pipe buffer deadlock (#166)
Browse files Browse the repository at this point in the history
  • Loading branch information
lgoettgens authored and fingolfin committed Aug 24, 2023
1 parent c19e244 commit 37e82e3
Showing 1 changed file with 4 additions and 6 deletions.
10 changes: 4 additions & 6 deletions src/ambiguities.jl
Original file line number Diff line number Diff line change
Expand Up @@ -126,13 +126,11 @@ function _find_ambiguities(
end
cmd = `$cmd --startup-file=no -e $code`

out = Pipe()
err = Pipe()
outfile, out = mktemp()
errfile, err = mktemp()
succ = success(pipeline(cmd; stdout = out, stderr = err))
close(out.in)
close(err.in)
strout = String(read(out))
strerr = String(read(err))
strout = read(outfile, String)
strerr = read(errfile, String)
num_ambiguities = if succ
0
else
Expand Down

0 comments on commit 37e82e3

Please sign in to comment.