lib/childprocess/windows/process.rb in childprocess-0.3.9 vs lib/childprocess/windows/process.rb in childprocess-0.4.0
- old
+ new
@@ -19,15 +19,19 @@
ensure
@handle.close
end
def wait
- @handle.wait
- @exit_code = @handle.exit_code
- @handle.close
+ if exited?
+ exit_code
+ else
+ @handle.wait
+ @exit_code = @handle.exit_code
+ @handle.close
- @exit_code
+ @exit_code
+ end
end
def exited?
return true if @exit_code
assert_started
@@ -47,10 +51,9 @@
private
def launch_process
builder = ProcessBuilder.new(@args)
- builder.inherit = false
builder.detach = detach?
builder.duplex = duplex?
builder.environment = @environment unless @environment.empty?
builder.cwd = @cwd