1
0
mirror of https://github.com/OpenNebula/one.git synced 2025-03-16 22:50:10 +03:00

Close handles of open3 calls

git-svn-id: http://svn.opennebula.org/one/trunk@344 3034c82b-c49b-4eb3-8279-a7acafdc01c0
This commit is contained in:
Javier Fontán Muiños 2009-02-09 17:16:23 +00:00
parent 8792c16f7f
commit 6119f446b6

View File

@ -56,7 +56,15 @@ private
std=Open3.popen3(
"#{command} ;"+
" echo ExitCode: $? 1>&2")
[std[1].read, std[2].read]
std[0].close if !std[0].closed?
stdout=std[1].read
std[1].close if !std[1].closed?
stderr=std[2].read
std[2].close if !std[2].closed?
[stdout, stderr]
end
end
@ -78,8 +86,15 @@ private
std=Open3.popen3(
"ssh -n #{host} #{command} ;"+
" echo ExitCode: $? 1>&2")
std[0].close
[std[1].read, std[2].read]
std[0].close if !std[0].closed?
stdout=std[1].read
std[1].close if !std[1].closed?
stderr=std[2].read
std[2].close if !std[2].closed?
[stdout, stderr]
end
end