summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMatt Wrock <matt@mattwrock.com>2015-10-22 12:56:02 -0700
committerMatt Wrock <matt@mattwrock.com>2015-10-22 12:56:02 -0700
commitc3c49f95284c7ab0bce799d1f52b817b0de4904d (patch)
treee60430bc4494c0b6176d92fa8a9fc7a51ea2a873
parent8396810eac9c733437118243be87fae40f11ecc4 (diff)
downloadmixlib-shellout-c3c49f95284c7ab0bce799d1f52b817b0de4904d.tar.gz
add a comment for the recursive function
-rw-r--r--lib/mixlib/shellout/windows.rb4
1 files changed, 4 insertions, 0 deletions
diff --git a/lib/mixlib/shellout/windows.rb b/lib/mixlib/shellout/windows.rb
index 571baa6..14aca55 100644
--- a/lib/mixlib/shellout/windows.rb
+++ b/lib/mixlib/shellout/windows.rb
@@ -321,6 +321,10 @@ module Mixlib
File.executable?(path) && !File.directory?(path)
end
+ # recursively kills all child processes of given pid
+ # calls itself querying for children child procs until
+ # none remain. Important that a single WmiLite instance
+ # is passed in since each creates its own WMI rpc process
def self.kill_process_tree(pid, wmi, logger)
wmi.query("select * from Win32_Process where ParentProcessID=#{pid}").each do |instance|
child_pid = instance.wmi_ole_object.processid