Skip to content

Commit 7e3493b

Browse files
committed
Merge branch 'ticket/stable/22878-close-handle' into stable
* ticket/stable/22878-close-handle: (#22878) Scope call to CloseHandle
2 parents 11f7c51 + ced7086 commit 7e3493b

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

lib/puppet/util/execution.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -147,8 +147,8 @@ def self.execute(command, options = NoOptionsSpecified)
147147
begin
148148
exit_status = Puppet::Util::Windows::Process.wait_process(process_info.process_handle)
149149
ensure
150-
Process.CloseHandle(process_info.process_handle)
151-
Process.CloseHandle(process_info.thread_handle)
150+
Puppet::Util::Windows::Process.CloseHandle(process_info.process_handle)
151+
Puppet::Util::Windows::Process.CloseHandle(process_info.thread_handle)
152152
end
153153
end
154154

spec/unit/util/execution_spec.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -306,8 +306,8 @@ def stub_process_wait(exitstatus)
306306
Puppet::Util::Execution.stubs(:execute_windows).returns(proc_info_stub)
307307

308308
Puppet::Util::Windows::Process.expects(:wait_process).with(process_handle).raises('whatever')
309-
Process.expects(:CloseHandle).with(thread_handle)
310-
Process.expects(:CloseHandle).with(process_handle)
309+
Puppet::Util::Windows::Process.expects(:CloseHandle).with(thread_handle)
310+
Puppet::Util::Windows::Process.expects(:CloseHandle).with(process_handle)
311311

312312
expect { Puppet::Util::Execution.execute('test command') }.to raise_error(RuntimeError)
313313
end

0 commit comments

Comments
 (0)