~ubuntu-branches/debian/sid/ohai/sid

« back to all changes in this revision

Viewing changes to lib/ohai/mixin/command.rb

  • Committer: Package Import Robot
  • Author(s): Tollef Fog Heen
  • Date: 2012-05-31 22:57:21 UTC
  • mfrom: (1.1.8)
  • Revision ID: package-import@ubuntu.com-20120531225721-3ftpjcx50o1u6fb2
Tags: 6.14.0-1
New upstream version

Show diffs side-by-side

added added

removed removed

Lines of Context:
128
128
      #
129
129
      # Thanks Ara!
130
130
      def popen4(cmd, args={}, &b)
131
 
 
 
131
        
 
132
        ## Disable garbage collection to work around possible bug in MRI
 
133
  # Ruby 1.8 suffers from intermittent segfaults believed to be due to GC while IO.select
 
134
  # See OHAI-330 / CHEF-2916 / CHEF-1305
 
135
        GC.disable
 
136
        
132
137
        # Waitlast - this is magic.
133
138
        #
134
139
        # Do we wait for the child process to die before we yield
334
339
        end
335
340
      rescue Errno::ENOENT
336
341
        raise Ohai::Exceptions::Exec, "command #{cmd} doesn't exist or is not in the PATH"
 
342
      ensure
 
343
        # we disabled GC entering
 
344
        GC.enable
337
345
      end
338
346
 
339
347
      module_function :popen4