Skip to content

Commit cfaa112

Browse files
committed
fix
1 parent 38a9453 commit cfaa112

File tree

3 files changed

+6
-4
lines changed

3 files changed

+6
-4
lines changed

ci/windows.ps1

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ Write-Output "::group::Info"
44
Write-Output "Target: $env:CI_TARGET"
55
Write-Output "::group::Running tests"
66

7-
$env:RUST_BACKTRACE = full
7+
$env:RUST_BACKTRACE = "full"
88
./tests/$env:CI_TARGET/minion-tests.exe --trace
99
if ($LASTEXITCODE -ne 0) {
1010
throw "tests failed"

src/windows/child.rs

+3-1
Original file line numberDiff line numberDiff line change
@@ -35,9 +35,11 @@ impl WindowsChildProcess {
3535
cwd: options.pwd.into(),
3636
},
3737
)?;
38+
let child = OwnedHandle::new(info.hProcess);
39+
options.sandbox.job.add_process(&child)?;
3840

3941
Ok(WindowsChildProcess {
40-
child: OwnedHandle::new(info.hProcess),
42+
child,
4143
main_thread: OwnedHandle::new(info.hThread),
4244
stdin: child_stdin,
4345
stdout: child_stdout,

src/windows/constrain.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -68,11 +68,11 @@ impl Job {
6868
pub(crate) fn kill(&self) -> Result<(), Error> {
6969
unsafe { Cvt::nonzero(TerminateJobObject(self.handle.as_raw(), 0xDEADBEEF)).map(|_| ()) }
7070
}
71-
pub(crate) fn add_process(&self, process_handle: HANDLE) -> Result<(), Error> {
71+
pub(crate) fn add_process(&self, process_handle: &OwnedHandle) -> Result<(), Error> {
7272
unsafe {
7373
Cvt::nonzero(AssignProcessToJobObject(
7474
self.handle.as_raw(),
75-
process_handle,
75+
process_handle.as_raw(),
7676
))
7777
.map(|_| ())
7878
}

0 commit comments

Comments
 (0)