Skip to content

Commit 5d9d980

Browse files
committed
Windows master fixes
There was some lint on windows builds. One in particular was a significant issue - the missing call to size_of meant that we were actively lying to the windows kernel about the size of our SECURITY_ATTRIBUTES structure. Fortunately there is no user supplied data in this call.
1 parent 96bc015 commit 5d9d980

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

src/cli/self_update.rs

+2-3
Original file line numberDiff line numberDiff line change
@@ -964,7 +964,7 @@ fn delete_rustup_and_cargo_home() -> Result<()> {
964964

965965
// Make the sub-process opened by gc exe inherit its attribute.
966966
let mut sa = SECURITY_ATTRIBUTES {
967-
nLength: mem::size_of::<SECURITY_ATTRIBUTES> as DWORD,
967+
nLength: mem::size_of::<SECURITY_ATTRIBUTES>() as DWORD,
968968
lpSecurityDescriptor: ptr::null_mut(),
969969
bInheritHandle: 1,
970970
};
@@ -1039,7 +1039,6 @@ pub fn complete_windows_uninstall() -> Result<()> {
10391039
fn wait_for_parent() -> Result<()> {
10401040
use std::io;
10411041
use std::mem;
1042-
use std::ptr;
10431042
use winapi::shared::minwindef::DWORD;
10441043
use winapi::um::handleapi::{CloseHandle, INVALID_HANDLE_VALUE};
10451044
use winapi::um::processthreadsapi::{GetCurrentProcessId, OpenProcess};
@@ -1089,7 +1088,7 @@ fn wait_for_parent() -> Result<()> {
10891088

10901089
// Get a handle to the parent process
10911090
let parent = OpenProcess(SYNCHRONIZE, 0, parent_id);
1092-
if parent == ptr::null_mut() {
1091+
if parent.is_null() {
10931092
// This just means the parent has already exited.
10941093
return Ok(());
10951094
}

0 commit comments

Comments
 (0)