Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 7 additions & 1 deletion src/tools/remote-test-server/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -337,7 +337,13 @@ fn get_status_code(status: &ExitStatus) -> (u8, i32) {
}
}

#[cfg(any(windows, target_os = "motor", target_os = "uefi"))]
#[cfg(target_os = "uefi")]
fn get_status_code(status: &ExitStatus) -> (u8, i32) {
let status = status.code().unwrap();
if (status & i32::MIN) != 0 { (1, status & !i32::MIN) } else { (0, status) }

@Mark-Simulacrum Mark-Simulacrum Oct 25, 2026 •

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this is 'just' getting the sign bit, and if it's negative returning (1, positive value)?

Is there a reason we're not writing that more directly?

View changes since the review

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Well, I wrote it this way to mirror what we do when constructing the error code in std:

if self.0.is_error() {

I don't particularly mind changing it to just check for the sign, but this way of writing it kinda preserves that UEFI doesn't actuallly have an i32 error code. Just a code desguised as i32 (at least to me).

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hm, okay, I guess that seems reasonable enough.

}

#[cfg(any(windows, target_os = "motor"))]
fn get_status_code(status: &ExitStatus) -> (u8, i32) {
(0, status.code().unwrap())
}
Expand Down
Loading