summaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
Diffstat (limited to 'lib')
-rw-r--r--lib/puppet/util.rb21
1 files changed, 12 insertions, 9 deletions
diff --git a/lib/puppet/util.rb b/lib/puppet/util.rb
index cc2822f3b..3752a6dac 100644
--- a/lib/puppet/util.rb
+++ b/lib/puppet/util.rb
@@ -291,20 +291,23 @@ module Util
begin
output_read.close
- if arguments[:stdinfile]
- $stdin.reopen(arguments[:stdinfile])
- else
- $stdin.close
- end
if arguments[:squelch]
- $stdout.close
+ output_write.close
+ $stdout.reopen('/dev/null', 'w')
+ $stderr.reopen('/dev/null', 'w')
else
$stdout.reopen(output_write)
+ if arguments[:combine]
+ $stderr.reopen(output_write)
+ else
+ $stderr.reopen('/dev/null', 'w')
+ end
end
- if arguments[:combine]
- $stderr.reopen(output_write)
+
+ if arguments[:stdinfile]
+ $stdin.reopen(arguments[:stdinfile])
else
- $stderr.close
+ $stdin.close
end
3.upto(256){|fd| IO::new(fd).close rescue nil}