Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 185857
b: refs/heads/ob/gctune
c: 322ff51
h: refs/heads/master
i:
  185855: 7013303
v: v3
  • Loading branch information
JeffBezanson committed Jul 14, 2015
1 parent 7480f30 commit 9798491
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 2 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,7 @@ refs/heads/jn/ppc: 335263566ad81075d26ff11d9f5be593ed288d5d
refs/heads/moon/hygienic-macros: 4fb0c21b964f3ff3a878853c30214d74eb8b1971
refs/heads/nalimilan/e: beea5bc83014f38bf6eae7a9571e5c19e92a7633
refs/heads/ob/gcscrub: b0c99bee432fdd0e6f71b5f2b4148d519568a21d
refs/heads/ob/gctune: 4086188ba62c9e841c3e290584a8c436e9acfc93
refs/heads/ob/gctune: 322ff513a76c56486ad006d89cc61559a38e47ad
refs/heads/sb/rem-nearest: 1b84e72fa3bd62b453113e9199254dfaf07bffb3
refs/heads/sf/examplesfix: 0f93055c87387a07869466463b9d1317f9bcd120
refs/heads/sjk/commit-hooks: 907e315e07bd01f199838afff8edcaeed4bb8f64
Expand Down
5 changes: 4 additions & 1 deletion branches/ob/gctune/base/process.jl
Original file line number Diff line number Diff line change
Expand Up @@ -394,7 +394,10 @@ spawn_opts_swallow(in::Redirectable=DevNull, out::Redirectable=DevNull, err::Red
(tuple(in,out,err,args...),false,false)
spawn_opts_inherit(stdios::StdIOSet, exitcb::Callback=false, closecb::Callback=false) =
(stdios,exitcb,closecb)
spawn_opts_inherit(in::Redirectable=STDIN, out::Redirectable=STDOUT, err::Redirectable=STDERR, args...) =
# pass original descriptors to child processes by default, because we might
# have already exhausted and closed the libuv object for our standard streams.
# this caused issue #8529.
spawn_opts_inherit(in::Redirectable=RawFD(0), out::Redirectable=RawFD(1), err::Redirectable=RawFD(2), args...) =
(tuple(in,out,err,args...),false,false)

spawn(pc::ProcessChainOrNot, cmds::AbstractCmd, args...) = spawn(pc, cmds, spawn_opts_swallow(args...)...)
Expand Down
15 changes: 15 additions & 0 deletions branches/ob/gctune/test/spawn.jl
Original file line number Diff line number Diff line change
Expand Up @@ -209,3 +209,18 @@ let bad = "bad\0name"
@test_throws ArgumentError run(setenv(`echo hello`, bad=>"good"))
@test_throws ArgumentError run(setenv(`echo hello`, "good"=>bad))
end

# issue #8529
@test_throws ErrorException run(pipe(Base.Pipe(C_NULL), `cat`))
let fname = tempname()
open(fname, "w") do f
println(f, "test")
end
code = """
for line in eachline(STDIN)
run(pipe(`echo asdf`,`cat`))
end
"""
@test success(pipe(`cat $fname`, `$exename -e $code`))
rm(fname)
end

0 comments on commit 9798491

Please sign in to comment.