diff options
author | Matt Wrock <matt@mattwrock.com> | 2015-10-22 12:56:02 -0700 |
---|---|---|
committer | Matt Wrock <matt@mattwrock.com> | 2015-10-22 12:56:02 -0700 |
commit | c3c49f95284c7ab0bce799d1f52b817b0de4904d (patch) | |
tree | e60430bc4494c0b6176d92fa8a9fc7a51ea2a873 | |
parent | 8396810eac9c733437118243be87fae40f11ecc4 (diff) | |
download | mixlib-shellout-c3c49f95284c7ab0bce799d1f52b817b0de4904d.tar.gz |
add a comment for the recursive function
-rw-r--r-- | lib/mixlib/shellout/windows.rb | 4 |
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 |