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
4 changes: 2 additions & 2 deletions src/uu/chroot/src/chroot.rs
Original file line number Diff line number Diff line change
Expand Up @@ -439,7 +439,7 @@
let err = unsafe {
chroot(
CString::new(root.as_os_str().as_bytes().to_vec())
.unwrap()
.map_err(|e| ChrootError::CannotEnter("root".to_string(), e.into()))?
.as_bytes_with_nul()
.as_ptr()
.cast::<libc::c_char>(),
Expand All @@ -448,7 +448,7 @@

if err == 0 {
if !skip_chdir {
std::env::set_current_dir("/").unwrap();
std::env::set_current_dir("/")?;

Check warning on line 451 in src/uu/chroot/src/chroot.rs

View check run for this annotation

Codecov / codecov/patch

src/uu/chroot/src/chroot.rs#L451

Added line #L451 was not covered by tests
}
Ok(())
} else {
Expand Down
Loading