From 79460f61229efe76218195b7fb366348d428a1d2 Mon Sep 17 00:00:00 2001 From: Mitchell Hashimoto Date: Wed, 21 Dec 2011 22:12:22 -0800 Subject: [PATCH] Subprocess: Check if data is empty after the process exits as well --- lib/vagrant/util/subprocess.rb | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/lib/vagrant/util/subprocess.rb b/lib/vagrant/util/subprocess.rb index 9c26a7e64..d8585d14d 100644 --- a/lib/vagrant/util/subprocess.rb +++ b/lib/vagrant/util/subprocess.rb @@ -105,10 +105,15 @@ module Vagrant # amount of text between the time we last read data and when the # process exited. [stdout, stderr].each do |io| + # Read the extra data, ignoring if there isn't any extra_data = read_io(io) + next if extra_data == "" + + # Log it out and accumulate @logger.debug(extra_data) io_data[io] += extra_data + # Yield to any listeners any remaining data io_name = io == stdout ? :stdout : :stderr yield io_name, extra_data if block_given? end