fix: Use cwd_guard directly to prevent deadlock in chdir

This commit is contained in:
Ibuki Omatsu
2026-03-01 14:04:01 +00:00
committed by Jeremy Soller
parent 3acebe2b87
commit 9cde64a321
+1 -1
View File
@@ -93,7 +93,7 @@ pub fn chdir(path: &str) -> Result<()> {
let mut cwd_guard = CWD.write();
let (is_relative, path) = normalize_path(path).ok_or(Error::new(ENOENT))?;
if is_relative {
let fd = current_dir()?
let fd = cwd_guard
.as_ref()
.unwrap()
.fd