Skip to content

Commit 81dd75a

Browse files
authored
Rollup merge of #164617 - Ayush1325:uefi-tests, r=Mark-Simulacrum
tools: remote-test-server: Fix UEFI crash return code - compiletest detects crash as an error code > 127. - This does not work for UEFI, since UEFI errors are usize by default, and when converting to i32, we just remove the bits in middle. Eg: 0x8000000000000007 becomes 0x80000007 - So in case of crash, we get a negetive value as error instead of the expected signal when the host is linux.
2 parents 8592206 + f608dbf commit 81dd75a

1 file changed

Lines changed: 7 additions & 1 deletion

File tree

  • src/tools/remote-test-server/src

‎src/tools/remote-test-server/src/main.rs‎

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -337,7 +337,13 @@ fn get_status_code(status: &ExitStatus) -> (u8, i32) {
337337
}
338338
}
339339

340-
#[cfg(any(windows, target_os = "motor", target_os = "uefi"))]
340+
#[cfg(target_os = "uefi")]
341+
fn get_status_code(status: &ExitStatus) -> (u8, i32) {
342+
let status = status.code().unwrap();
343+
if (status & i32::MIN) != 0 { (1, status & !i32::MIN) } else { (0, status) }
344+
}
345+
346+
#[cfg(any(windows, target_os = "motor"))]
341347
fn get_status_code(status: &ExitStatus) -> (u8, i32) {
342348
(0, status.code().unwrap())
343349
}

0 commit comments

Comments
 (0)