mirror of
https://github.com/rust-lang/rust.git
synced 2025-05-14 02:49:40 +00:00
Fix process-spawn-nonexistent on WSL
If appendWindowsPath is set to true (the default IIRC), running invalid commands returns PermissionDenied instead of NotFound.
This commit is contained in:
parent
ff693dc7b8
commit
29cfefd355
@ -6,9 +6,11 @@ use std::io::ErrorKind;
|
||||
use std::process::Command;
|
||||
|
||||
fn main() {
|
||||
assert_eq!(Command::new("nonexistent")
|
||||
.spawn()
|
||||
.unwrap_err()
|
||||
.kind(),
|
||||
ErrorKind::NotFound);
|
||||
let result = Command::new("nonexistent").spawn().unwrap_err().kind();
|
||||
|
||||
assert!(matches!(
|
||||
result,
|
||||
// Under WSL with appendWindowsPath=true, this fails with PermissionDenied
|
||||
ErrorKind::NotFound | ErrorKind::PermissionDenied
|
||||
));
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user