Skip to content

Commit

Permalink
Merge branch 'master' into dev
Browse files Browse the repository at this point in the history
* master:
  Cover Ruby 2.6 on travis and appveyor
  Rewrite unix fork reopen to be compatible with ruby 2.6
  • Loading branch information
sds committed Jun 4, 2019
2 parents b1c09e8 + 982b1ae commit f7f671a
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 2 deletions.
1 change: 1 addition & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ rvm:
- 2.3
- 2.4
- 2.5
- 2.6
- ruby-head

sudo: false
Expand Down
6 changes: 6 additions & 0 deletions appveyor.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,12 @@ environment:
- CHILDPROCESS_POSIX_SPAWN: false
CHILDPROCESS_UNSET: should-be-unset
RUBY_VERSION: 25-x64
- CHILDPROCESS_POSIX_SPAWN: true
CHILDPROCESS_UNSET: should-be-unset
RUBY_VERSION: 26-x64
- CHILDPROCESS_POSIX_SPAWN: false
CHILDPROCESS_UNSET: should-be-unset
RUBY_VERSION: 26-x64

install:
- set PATH=C:\Ruby%RUBY_VERSION%\bin;%PATH%
Expand Down
12 changes: 10 additions & 2 deletions lib/childprocess/unix/fork_exec_process.rb
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,16 @@ def launch_process
exec_r.close
set_env

STDOUT.reopen(stdout || "/dev/null")
STDERR.reopen(stderr || "/dev/null")
if stdout
STDOUT.reopen(stdout)
else
STDOUT.reopen("/dev/null", "a+")
end
if stderr
STDERR.reopen(stderr)
else
STDERR.reopen("/dev/null", "a+")
end

if duplex?
STDIN.reopen(reader)
Expand Down

0 comments on commit f7f671a

Please sign in to comment.