lib/rbbt/util/cmd.rb in rbbt-util-5.21.3 vs lib/rbbt/util/cmd.rb in rbbt-util-5.21.4
- old
+ new
@@ -116,20 +116,27 @@
end
else
sin.close
end
+ if no_wait
+ pids = []
+ else
+ pids = [pid]
+ end
+
if pipe
Thread.new do
while line = serr.gets
Log.log line, stderr if Integer === stderr and log
end
serr.close
end
#SmartIO.tie sout, pid, cmd, post, in_content, sin, serr
- ConcurrentStream.setup sout, :pids => [pid], :autojoin => no_wait, :no_fail => no_fail
+ #
+ ConcurrentStream.setup sout, :pids => pids, :autojoin => no_wait, :no_fail => no_fail
sout
else
err = ""
Thread.new do
@@ -137,10 +144,10 @@
err << serr.gets if Integer === stderr
end
serr.close
end
- ConcurrentStream.setup sout, :pids => [pid], :autojoin => no_wait, :no_fail => no_fail
+ ConcurrentStream.setup sout, :pids => pids, :autojoin => no_wait, :no_fail => no_fail
out = StringIO.new sout.read
sout.close unless sout.closed?
Process.waitpid pid